com.groupdocs.metadata

Interfaces

Classes

Exceptions

com.groupdocs.metadata

Class FileFormatChecker

  • All Implemented Interfaces:
    com.aspose.ms.System.IDisposable, Closeable, AutoCloseable


    public final class FileFormatChecker
    extends Object
    implements com.aspose.ms.System.IDisposable, Closeable

    Verifies file signature for different formats.

    • Constructor Detail

      • FileFormatChecker

        public FileFormatChecker(InputStream stream)

        Initializes a new instance of the FileFormatChecker class.

        Parameters:
        stream - Checked file stream.
        Throws:
        ArgumentNullException - Stream could not be null.
        com.aspose.ms.System.ArgumentException - Stream should be seekable.
      • FileFormatChecker

        public FileFormatChecker(String filePath)

        Initializes a new instance of the FileFormatChecker class.

        Parameters:
        filePath - Absolute path to the checked file.
    • Method Detail

      • getDocumentType

        public final int getDocumentType()

        Verifies file stream and returns appropriate DocumentType.

        Returns:
        Appropriate DocumentType if file is recognized; otherwise DocumentType.Unknown.
      • verifyFormat

        public final boolean verifyFormat(int documentType)

        Determines whether file has specific format.

        Parameters:
        documentType - Checked document type.
        Returns:
        true if checked file has documentType type; otherwise false.
      • dispose

        public final void dispose()

        Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

        Specified by:
        dispose in interface com.aspose.ms.System.IDisposable