public final class FileFormatChecker extends Object implements com.aspose.ms.System.IDisposable, Closeable
Defines operations intended to verify the file signature for different formats.
Constructor and Description |
---|
FileFormatChecker(InputStream stream)
Initializes a new instance of the
FileFormatChecker class. |
FileFormatChecker(String filePath)
Initializes a new instance of the
FileFormatChecker class. |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
|
int |
getDocumentType()
Verifies the file stream and returns the appropriate
DocumentType . |
boolean |
verifyFormat(int documentType)
Determines whether the file has a specific format.
|
public FileFormatChecker(InputStream stream)
Initializes a new instance of the FileFormatChecker
class.
stream
- A stream that contains the data to examine.public FileFormatChecker(String filePath)
Initializes a new instance of the FileFormatChecker
class.
filePath
- A string that contains the full name of the file to examine.public final int getDocumentType()
Verifies the file stream and returns the appropriate DocumentType
.
DocumentType
if file is recognized; otherwise, DocumentType.Unknown
.public final boolean verifyFormat(int documentType)
Determines whether the file has a specific format.
documentType
- Checked document type.documentType
type; otherwise false.public final void dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
dispose
in interface com.aspose.ms.System.IDisposable
public final void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2019. All rights reserved.