FileInfo
Leave feedback
On this page
public interface FileInfo
Contains information about a file.
The FileInfo interface defines the contract for accessing and retrieving information about a file in the GroupDocs.Viewer component. It provides methods to retrieve details such as the file type, encryption and so on.
Example usage:
try (Viewer viewer = new Viewer("document.pdf")) {
FileInfo fileInfo = viewer.getFileInfo();
// Use the fileInfo object for further operations
}
Note: The default implementation of this interface is FileInfoImpl.
| Method | Description |
|---|---|
| getFileType() | Retrieves the type of the file. |
| setFileType(FileType fileType) | Sets the type of the file. |
| isEncrypted() | Checks if the file is encrypted. |
| setEncrypted(boolean encrypted) | Sets the encryption status of the file. |
public abstract FileType getFileType()
Retrieves the type of the file.
Returns: FileType - the file type.
public abstract void setFileType(FileType fileType)
Sets the type of the file.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| fileType | FileType | the file type. |
public abstract boolean isEncrypted()
Checks if the file is encrypted.
Returns: boolean - true if the file is encrypted, false otherwise.
public abstract void setEncrypted(boolean encrypted)
Sets the encryption status of the file.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| encrypted | boolean | true to indicate that the file is encrypted, false otherwise. |
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.