FileOutputAdapter

Inheritance: java.lang.Object, com.groupdocs.search.common.ResultBuilderFactory, com.groupdocs.search.common.OutputAdapter

All Implemented Interfaces: com.groupdocs.search.common.IFileOutputAdapter

public class FileOutputAdapter extends OutputAdapter implements IFileOutputAdapter

Represents an output adapter that collects output into a file.

Learn more

The example demonstrates a typical usage of the class.


 String indexFolder = "c:\\MyIndex\\";
 String documentsFolder = "c:\\MyDocuments\\";
 Index index = new Index(indexFolder); // Creating an index in the specified folder
 index.add(documentsFolder); // Indexing documents from the specified folder
 DocumentInfo[] documents = index.getIndexedDocuments(); // Getting information on indexed documents
 FileOutputAdapter adapter = new FileOutputAdapter("c:\\DocumentText.htm"); // Creating a file output adapter
 index.getDocumentText(documents[0], adapter); // Generating a document text into the output file
 

Constructors

Constructor Description
FileOutputAdapter(OutputFormat outputFormat, String filePath) Initializes a new instance of the FileOutputAdapter class.

Methods

Method Description
getFilePath() Gets an output file path.

FileOutputAdapter(OutputFormat outputFormat, String filePath)

public FileOutputAdapter(OutputFormat outputFormat, String filePath)

Initializes a new instance of the FileOutputAdapter class.

Parameters:

Parameter Type Description
outputFormat OutputFormat The output format.
filePath java.lang.String The output file path.

getFilePath()

public final String getFilePath()

Gets an output file path.

Returns: java.lang.String - The output file path.