public interface Attachment
The Attachment interface defines the contract for accessing and manipulating attachment files in the GroupDocs.Viewer component. It provides methods to retrieve information such as file name, size, and content type of the attachment.
Example usage:
try (Viewer viewer = new Viewer("document.eml")) {
List<Attachment> attachments = viewer.getAttachments();
// Use the attachments object for further operations
}
Note: The default implementation of this interface is AttachmentImpl.
Viewer| Modifier and Type | Method and Description |
|---|---|
String |
getFileName()
Retrieves the file name of the attachment.
|
String |
getFilePath()
Retrieves the relative path of the attachment.
|
FileType |
getFileType()
Retrieves the file type of the attachment.
|
String |
getId()
Retrieves the unique identifier of the attachment within the context of a single file that contains this attachment.
|
long |
getSize()
Retrieves the file size of the attachment in bytes.
|
void |
setFileName(String fileName)
Sets the file name of the attachment.
|
void |
setFilePath(String filePath)
Sets the relative path of the attachment.
|
void |
setFileType(FileType fileType)
Sets the file type of the attachment.
|
void |
setId(String id)
Sets the unique identifier of the attachment.
|
void |
setSize(long size)
Sets the file size of the attachment in bytes.
|
String getFileName()
Retrieves the file name of the attachment.
String getFilePath()
Retrieves the relative path of the attachment. The path can be in the format "folder/file.docx" when the file is located within a folder, or it can be the filename when the file is located in the root of an archive, an e-mail message, or a data file.
FileType getFileType()
Retrieves the file type of the attachment.
FileTypeString getId()
Retrieves the unique identifier of the attachment within the context of a single file that contains this attachment.
long getSize()
Retrieves the file size of the attachment in bytes.
void setFileName(String fileName)
fileName - the file name to set.void setFilePath(String filePath)
filePath - the relative path to set.void setFileType(FileType fileType)
fileType - the file type to set.FileTypevoid setId(String id)
id - the unique identifier to set.void setSize(long size)
size - the file size to set.Copyright © 2025. All rights reserved.