com.groupdocs.watermark

Interfaces

Classes

Exceptions

com.groupdocs.watermark

Interface IDocumentFactory

  • All Known Implementing Classes:
    DocumentFactory


    public interface IDocumentFactory

    Represents a factory for creating instances of documents.

    • Method Detail

      • load

        Document load(String filePath)

        Loads a new document from the specified file.

        Parameters:
        filePath - The file path to load document from.
        Returns:
        Instance of appropriate descendant of Document class.
        Throws:
        UnsupportedFileTypeException - Supplied document type is not supported.
      • load

        Document load(String filePath,
                    LoadOptions loadOptions)

        Loads a new document from the specified file.

        Parameters:
        filePath - The file path to load document from.
        loadOptions - Additional options to use when loading a document.
        Returns:
        Instance of appropriate descendant of Document class.
        Throws:
        UnsupportedFileTypeException - Supplied document type is not supported.
      • load

        Document load(InputStream stream)

        Loads a new document from the specified stream.

        Parameters:
        stream - The stream to load document from.
        Returns:
        Instance of appropriate descendant of Document class.
        Throws:
        UnsupportedFileTypeException - Supplied document type is not supported.
      • load

        Document load(InputStream stream,
                    LoadOptions loadOptions)

        Loads a new document from the specified stream.

        Parameters:
        stream - The stream to load document from.
        loadOptions - Additional options to use when loading a document.
        Returns:
        Instance of appropriate descendant of Document class.
        Throws:
        UnsupportedFileTypeException - Supplied document type is not supported.
      • load

        <TDocument extends Document> TDocument load(Class<TDocument> documentType,
                                                  String filePath)

        Loads a new document from the specified file.

        Parameters:
        filePath - The file path to load document from.
        documentType - Expected document type (according to specified file type).

        TDocument: Expected document type (according to specified file type).

        Returns:
        Instance of TDocument class.
        Throws:
        UnsupportedFileTypeException - Supplied document type is not supported.
      • load

        <TDocument extends Document> TDocument load(Class<TDocument> documentType,
                                                  String filePath,
                                                  LoadOptions loadOptions)

        Loads a new document from the specified file.

        Parameters:
        filePath - The file path to load document from.
        loadOptions - Additional options to use when loading a document.
        documentType - Expected document type (according to specified file type).

        TDocument: Expected document type (according to specified file type).

        Returns:
        Instance of TDocument class.
        Throws:
        UnsupportedFileTypeException - Supplied document type is not supported.
      • load

        <TDocument extends Document> TDocument load(Class<TDocument> documentType,
                                                  InputStream stream)

        Loads a new document from the specified stream.

        Parameters:
        stream - The stream to load document from.
        documentType - Expected document type (according to specified file type).

        TDocument: Expected document type (according to specified stream content).

        Returns:
        Instance of TDocument class.
        Throws:
        UnsupportedFileTypeException - Supplied document type is not supported.
      • load

        <TDocument extends Document> TDocument load(Class<TDocument> documentType,
                                                  InputStream stream,
                                                  LoadOptions loadOptions)

        Loads a new document from the specified stream.

        Parameters:
        stream - The stream to load document from.
        loadOptions - Additional options to use when loading a document.
        documentType - Expected document type (according to specified file type).

        TDocument: Expected document type (according to specified stream content).

        Returns:
        Instance of TDocument class.
        Throws:
        UnsupportedFileTypeException - Supplied document type is not supported.
      • getInfo

        DocumentInfo getInfo(InputStream stream)

        Gets an information about the format of a document stored in the stream.

        Parameters:
        stream - The stream containing a document.
        Returns:
        A DocumentInfo instance that contains detected information.
      • getInfo

        DocumentInfo getInfo(String filePath)

        Gets an information about the format of a document stored in the file.

        Parameters:
        filePath - The file path.
        Returns:
        A DocumentInfo instance that contains detected information.