Class Zipper

  • All Implemented Interfaces:
    ZipModel

    public class Zipper
    extends java.lang.Object
    implements ZipModel
    The class Zipper
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Zipper.ZipperBuilder  
    • Constructor Summary

      Constructors 
      Constructor Description
      Zipper()
      Instantiates a new Zipper object
      Zipper​(int compressionMethod, java.io.File directoryToZip, java.lang.String dirToStart, int fileCounter, java.io.FilenameFilter fileFilter, long fileLength, java.io.File zipFile, java.lang.String zipFileComment, java.lang.String zipFileName, java.util.zip.ZipFile zipFileObj, int zipLevel)
      Instantiates a new Zipper object
      Zipper​(java.io.File dirToZip, java.io.File zipFile)
      Instantiates a new Zipper object
      Zipper​(java.io.File dirToZip, java.io.File zipFile, java.io.FilenameFilter filter)
      Instantiates a new Zipper object
    • Constructor Detail

      • Zipper

        public Zipper()
        Instantiates a new Zipper object
      • Zipper

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

        public Zipper​(java.io.File dirToZip,
                      java.io.File zipFile,
                      java.io.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,
                      java.io.File directoryToZip,
                      java.lang.String dirToStart,
                      int fileCounter,
                      java.io.FilenameFilter fileFilter,
                      long fileLength,
                      java.io.File zipFile,
                      java.lang.String zipFileComment,
                      java.lang.String zipFileName,
                      java.util.zip.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 Detail

      • 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 java.io.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​(java.io.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 java.lang.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​(java.lang.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 java.io.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​(java.io.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 java.io.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​(java.io.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 java.lang.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​(java.lang.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 java.lang.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​(java.lang.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 java.util.zip.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​(java.util.zip.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
      • toString

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

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