FileInfo

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.

Methods

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.

getFileType()

public abstract FileType getFileType()

Retrieves the type of the file.

Returns: FileType - the file type.

setFileType(FileType fileType)

public abstract void setFileType(FileType fileType)

Sets the type of the file.

Parameters:

Parameter Type Description
fileType FileType the file type.

isEncrypted()

public abstract boolean isEncrypted()

Checks if the file is encrypted.

Returns: boolean - true if the file is encrypted, false otherwise.

setEncrypted(boolean encrypted)

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.