- All Superinterfaces:
ArchiveService
- All Known Implementing Classes:
CommonsCompressArchiveReadService
,SevenZipArchiveService
Interface defining functionality associated with the reading of archives.
- Author:
- Aashutos Kakshepati
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.ntak.pearlzip.archive.pub.ArchiveService
ArchiveService.FXForm
-
Field Summary
Fields inherited from interface com.ntak.pearlzip.archive.pub.ArchiveService
CUSTOM_MENUS, DEFAULT_BUS, OPTIONS
-
Method Summary
Modifier and TypeMethodDescriptionboolean
extractFile
(long sessionId, Path targetLocation, ArchiveInfo archiveInfo, FileInfo file) Extracts the specified file by the FileInfo object supplied from the archive.boolean
extractFile
(long sessionId, Path targetLocation, String archivePath, FileInfo file) Extracts the specified file by the FileInfo object supplied from the archive.default ArchiveInfo
generateArchiveMetaData
(String archivePath) Extracts metadata from the archive specified and wraps it in an ArchiveInfo object.default Optional<javafx.scene.Node>
getOpenArchiveOptionsPane
(ArchiveInfo archiveInfo) Deprecated, for removal: This API element is subject to removal in a future version.listFiles
(long sessionId, ArchiveInfo archiveInfo) List contents of archive by the archive info object given.List contents of archive by archive path given.Deprecated, for removal: This API element is subject to removal in a future version.boolean
testArchive
(long sessionId, String archivePath) Checks the integrity of the archive.Methods inherited from interface com.ntak.pearlzip.archive.pub.ArchiveService
getAliasFormats, getCompressorArchives, getFXFormByIdentifier, getOptionsPane, getResourceBundle, isEnabled
-
Field Details
-
OPEN_ARCHIVE_OPTIONS
- See Also:
-
-
Method Details
-
generateArchiveMetaData
Extracts metadata from the archive specified and wraps it in an ArchiveInfo object. The default implementation does not parse the file and just returns the default archive setup with minimum configuration. The default archive has no guarantee of its compatibility with the underlying archive as it may have custom features enabled e.g. encryption.- Parameters:
archivePath
-- Returns:
- ArchiveInfo - POJO containing Archive Information parsed from the file metadata
-
listFiles
List contents of archive by archive path given. Hence, uses default archive info settings as per dictated by the archive service implementation.- Parameters:
sessionId
- Unique identifier representing the session the ProgressMessage will display messages forarchivePath
-- Returns:
- List<FileInfo> - List of normalised files and folders from the archive
-
listFiles
List contents of archive by the archive info object given. It can contain properties that can handle specific file specifications such as encryption methodology and credentials.- Parameters:
sessionId
- Unique identifier representing the session the ProgressMessage will display messages forarchiveInfo
-- Returns:
- List<FileInfo> - List of normalised files and folders from the archive
-
extractFile
Extracts the specified file by the FileInfo object supplied from the archive.- Parameters:
sessionId
- Unique identifier representing the session the ProgressMessage will display messages fortargetLocation
- Location to extract file toarchivePath
-file
- The File metadata from the archive that is to be extracted- Returns:
- boolean - returns true, if extraction was successful
-
extractFile
Extracts the specified file by the FileInfo object supplied from the archive. The archive info object can provide archive-specific configuration e.g. decryption passwords.- Parameters:
sessionId
- Unique identifier representing the session the ProgressMessage will display messages fortargetLocation
- Location to extract file toarchiveInfo
-file
- The File metadata from the archive that is to be extracted- Returns:
- boolean - returns true, if extraction was successful
-
testArchive
Checks the integrity of the archive. It is assumed that the archive headers are unencrypted. Hence, archive path would suffice.- Parameters:
sessionId
- Unique identifier representing the session the ProgressMessage will display messages forarchivePath
-- Returns:
- boolean - returns true if the archive is valid
-
getOpenArchiveOptionsPane
@Deprecated(forRemoval=true) default Optional<javafx.scene.Node> getOpenArchiveOptionsPane(ArchiveInfo archiveInfo) Deprecated, for removal: This API element is subject to removal in a future version.Given the archive information passed in, the implementation can use this method to determine whether a dialog needs to be presented to the user prior to opening the archive in order to provide suitable options and archive-specific configuration e.g. decryption passwords.- Parameters:
archiveInfo
-- Returns:
- Optional<Node> - The JavaFX Node representing the form to show prior to opening the archive or Empty if none is available.
-
supportedReadFormats
Deprecated, for removal: This API element is subject to removal in a future version.Lists out explicitly all archive formats that can be read by the implementation of the archive service.- Returns:
- List<String> - List of unique archive formats supported
-