Module file.worker

Class Zipper

java.lang.Object
io.github.astrapi69.file.zip.Zipper
All Implemented Interfaces:
ZipModel

public class Zipper extends Object implements ZipModel
The class Zipper
  • Constructor Details

    • Zipper

      public Zipper()
      Instantiates a new Zipper object
    • Zipper

      public Zipper(File dirToZip, File zipFile)
      Instantiates a new Zipper object
      Parameters:
      dirToZip - the dir to zip
      zipFile - the zip file
    • Zipper

      public Zipper(File dirToZip, File zipFile, FilenameFilter filter)
      Instantiates a new Zipper object
      Parameters:
      dirToZip - the dir to zip
      zipFile - the zip file
      filter - the filter
    • Zipper

      public Zipper(int compressionMethod, File directoryToZip, String dirToStart, int fileCounter, FilenameFilter fileFilter, long fileLength, File zipFile, String zipFileComment, String zipFileName, ZipFile zipFileObj, int zipLevel)
      Instantiates a new Zipper object
      Parameters:
      compressionMethod - the compression method
      directoryToZip - the directory to zip
      dirToStart - the directory to start
      fileCounter - the file counter
      fileFilter - the file name filter
      fileLength - the file length
      zipFile - the zip file
      zipFileComment - the zip file comment
      zipFileName - the zip file name
      zipFileObj - the zip file object
      zipLevel - the compression level
  • Method Details

    • builder

      public static Zipper.ZipperBuilder builder()
    • getCompressionMethod

      public int getCompressionMethod()
      Description copied from interface: ZipModel
      Returns the field compressionMethod.
      Specified by:
      getCompressionMethod in interface ZipModel
      Returns:
      The field compressionMethod.
    • setCompressionMethod

      public void setCompressionMethod(int compressionMethod)
      Description copied from interface: ZipModel
      Sets the field compressionMethod.
      Specified by:
      setCompressionMethod in interface ZipModel
      Parameters:
      compressionMethod - The compressionMethod to set
    • getDirectoryToZip

      public File getDirectoryToZip()
      Description copied from interface: ZipModel
      Returns the field directoryToZip.
      Specified by:
      getDirectoryToZip in interface ZipModel
      Returns:
      The field directoryToZip.
    • setDirectoryToZip

      public void setDirectoryToZip(File directoryToZip)
      Description copied from interface: ZipModel
      Sets the field directoryToZip.
      Specified by:
      setDirectoryToZip in interface ZipModel
      Parameters:
      directoryToZip - The directoryToZip to set
    • getDirToStart

      public String getDirToStart()
      Description copied from interface: ZipModel
      Returns the field dirToStart.
      Specified by:
      getDirToStart in interface ZipModel
      Returns:
      The field dirToStart.
    • setDirToStart

      public void setDirToStart(String dirToStart)
      Description copied from interface: ZipModel
      Sets the field dirToStart.
      Specified by:
      setDirToStart in interface ZipModel
      Parameters:
      dirToStart - The dirToStart to set
    • getFileCounter

      public int getFileCounter()
      Description copied from interface: ZipModel
      Returns the field fileCounter.
      Specified by:
      getFileCounter in interface ZipModel
      Returns:
      The field fileCounter.
    • setFileCounter

      public void setFileCounter(int fileCounter)
      Description copied from interface: ZipModel
      Sets the field fileCounter.
      Specified by:
      setFileCounter in interface ZipModel
      Parameters:
      fileCounter - The fileCounter to set
    • getFileFilter

      public FilenameFilter getFileFilter()
      Description copied from interface: ZipModel
      Returns the field fileFilter.
      Specified by:
      getFileFilter in interface ZipModel
      Returns:
      The field fileFilter.
    • setFileFilter

      public void setFileFilter(FilenameFilter fileFilter)
      Description copied from interface: ZipModel
      Sets the field fileFilter.
      Specified by:
      setFileFilter in interface ZipModel
      Parameters:
      fileFilter - The fileFilter to set
    • getFileLength

      public long getFileLength()
      Description copied from interface: ZipModel
      Returns the field fileLength.
      Specified by:
      getFileLength in interface ZipModel
      Returns:
      The field fileLength.
    • setFileLength

      public void setFileLength(long fileLength)
      Description copied from interface: ZipModel
      Sets the field fileLength.
      Specified by:
      setFileLength in interface ZipModel
      Parameters:
      fileLength - The fileLength to set
    • getZipFile

      public File getZipFile()
      Description copied from interface: ZipModel
      Returns the field zipFile.
      Specified by:
      getZipFile in interface ZipModel
      Returns:
      The field zipFile.
    • setZipFile

      public void setZipFile(File zipFile)
      Description copied from interface: ZipModel
      Sets the field zipFile.
      Specified by:
      setZipFile in interface ZipModel
      Parameters:
      zipFile - The zipFile to set
    • getZipFileComment

      public String getZipFileComment()
      Description copied from interface: ZipModel
      Returns the field zipFileComment.
      Specified by:
      getZipFileComment in interface ZipModel
      Returns:
      The field zipFileComment.
    • setZipFileComment

      public void setZipFileComment(String zipFileComment)
      Description copied from interface: ZipModel
      Sets the field zipFileComment.
      Specified by:
      setZipFileComment in interface ZipModel
      Parameters:
      zipFileComment - The zipFileComment to set
    • getZipFileName

      public String getZipFileName()
      Description copied from interface: ZipModel
      Returns the field zipFileName.
      Specified by:
      getZipFileName in interface ZipModel
      Returns:
      The field zipFileName.
    • setZipFileName

      public void setZipFileName(String zipFileName)
      Description copied from interface: ZipModel
      Sets the field zipFileName.
      Specified by:
      setZipFileName in interface ZipModel
      Parameters:
      zipFileName - The zipFileName to set
    • getZipFileObj

      public ZipFile getZipFileObj()
      Description copied from interface: ZipModel
      Returns the field zipFileObj.
      Specified by:
      getZipFileObj in interface ZipModel
      Returns:
      The field zipFileObj.
    • setZipFileObj

      public void setZipFileObj(ZipFile zipFileObj)
      Description copied from interface: ZipModel
      Sets the field zipFileObj.
      Specified by:
      setZipFileObj in interface ZipModel
      Parameters:
      zipFileObj - The zipFileObj to set
    • getZipLevel

      public int getZipLevel()
      Description copied from interface: ZipModel
      Returns the field zipLevel.
      Specified by:
      getZipLevel in interface ZipModel
      Returns:
      The field zipLevel.
    • setZipLevel

      public void setZipLevel(int zipLevel)
      Description copied from interface: ZipModel
      Sets the field zipLevel.
      Specified by:
      setZipLevel in interface ZipModel
      Parameters:
      zipLevel - The zipLevel to set
    • toBuilder

      public Zipper.ZipperBuilder toBuilder()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • zip

      public Optional<ZipErrorCodes> zip()
      Zip the given files of this object
      Returns:
      the optional with the possibles errors