Class FileOutputAdapter

  • public class FileOutputAdapter
    extends OutputAdapter
    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
    • Constructor Detail

      • FileOutputAdapter

        public FileOutputAdapter(OutputFormat outputFormat,
                                 String filePath)

        Initializes a new instance of the FileOutputAdapter class.

        outputFormat - The output format.
        filePath - The output file path.
      • FileOutputAdapter

        public FileOutputAdapter(String filePath)
        Deprecated. Please, use another class constructor.

        Initializes a new instance of the FileOutputAdapter class. HTML is used as the output format.

        filePath - The output file path.
    • Method Detail

      • getFilePath

        public final String getFilePath()

        Gets an output file path.

        The output file path.