Class CommonsCompressArchiveWriteService

java.lang.Object
com.ntak.pearlzip.archive.acc.pub.CommonsCompressArchiveWriteService
All Implemented Interfaces:
ArchiveService, ArchiveWriteService

public class CommonsCompressArchiveWriteService extends Object implements ArchiveWriteService
Implementation of an Archive Write Service, which utilises the Apache Commons Compress library underneath for various formats.
Author:
Aashutos Kakshepati
  • Constructor Details

    • CommonsCompressArchiveWriteService

      public CommonsCompressArchiveWriteService()
  • Method Details

    • createArchive

      public void createArchive(long sessionId, String archivePath, FileInfo... files)
      Description copied from interface: ArchiveWriteService
      Creates an archive at the path specified with optionally adding files to the archive.
      Specified by:
      createArchive in interface ArchiveWriteService
      Parameters:
      sessionId - Unique identifier representing the session the ProgressMessage will display messages for
    • createArchive

      public void createArchive(long sessionId, ArchiveInfo archiveInfo, FileInfo... files)
      Description copied from interface: ArchiveWriteService
      Creates an archive at the path specified with optionally adding files to the archive. The archive info object can provide archive-specific configuration e.g. decryption passwords.
      Specified by:
      createArchive in interface ArchiveWriteService
      Parameters:
      sessionId - Unique identifier representing the session the ProgressMessage will display messages for
    • addFile

      public boolean addFile(long sessionId, String archivePath, FileInfo... files)
      Description copied from interface: ArchiveWriteService
      Adds files(s) to the location within the archive as specified by the FileInfo object.
      Specified by:
      addFile in interface ArchiveWriteService
      Parameters:
      sessionId - Unique identifier representing the session the ProgressMessage will display messages for
      files - FileInfo archive metadata representing what is to be added to the archive
      Returns:
      boolean - returns true if file was added successfully
    • addFile

      public boolean addFile(long sessionId, ArchiveInfo archiveInfo, FileInfo... files)
      Description copied from interface: ArchiveWriteService
      Adds file(s) to the location within the archive as specified by the FileInfo object. The * archive info object can provide archive-specific configuration e.g. decryption passwords.
      Specified by:
      addFile in interface ArchiveWriteService
      Parameters:
      sessionId - Unique identifier representing the session the ProgressMessage will display messages for
      files - FileInfo archive metadata representing what is to be added to the archive
      Returns:
      boolean - returns true if file was added successfully
    • deleteFile

      public boolean deleteFile(long sessionId, String archivePath, FileInfo file)
      Description copied from interface: ArchiveWriteService
      Deletes the specified file represented by a FileInfo archive metadata from the specified archive.
      Specified by:
      deleteFile in interface ArchiveWriteService
      Parameters:
      sessionId - Unique identifier representing the session the ProgressMessage will display messages for
      file - FileInfo archive metadata representing what is to be deleted from the archive
      Returns:
      boolean - returns true if file is successfully deleted
    • deleteFile

      public boolean deleteFile(long sessionId, ArchiveInfo archiveInfo, FileInfo file)
      Description copied from interface: ArchiveWriteService
      Deletes the specified file represented by a FileInfo archive metadata from the specified archive. The archive info object can provide archive-specific configuration e.g. decryption passwords.
      Specified by:
      deleteFile in interface ArchiveWriteService
      Parameters:
      sessionId - Unique identifier representing the session the ProgressMessage will display messages for
      file - FileInfo archive metadata representing what is to be deleted from the archive
      Returns:
      boolean - returns true if file is successfully deleted
    • supportedWriteFormats

      public List<String> supportedWriteFormats()
      Description copied from interface: ArchiveWriteService
      Lists out explicitly all archive formats that can be written to by the implementation of the archive service.
      Specified by:
      supportedWriteFormats in interface ArchiveWriteService
      Returns:
      List<String> - List of archive extensions that can be created and modified by the archive service implementation