java.lang.Object
io.github.astrapi69.file.zip.Zipper
- All Implemented Interfaces:
ZipModel
The class
Zipper
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionZipper()
Instantiates a newZipper
objectZipper
(int compressionMethod, File directoryToZip, String dirToStart, int fileCounter, FilenameFilter fileFilter, long fileLength, File zipFile, String zipFileComment, String zipFileName, ZipFile zipFileObj, int zipLevel) Instantiates a newZipper
objectInstantiates a newZipper
objectZipper
(File dirToZip, File zipFile, FilenameFilter filter) Instantiates a newZipper
object -
Method Summary
Modifier and TypeMethodDescriptionstatic Zipper.ZipperBuilder
builder()
int
Returns the fieldcompressionMethod
.Returns the fielddirectoryToZip
.Returns the fielddirToStart
.int
Returns the fieldfileCounter
.Returns the fieldfileFilter
.long
Returns the fieldfileLength
.Returns the fieldzipFile
.Returns the fieldzipFileComment
.Returns the fieldzipFileName
.Returns the fieldzipFileObj
.int
Returns the fieldzipLevel
.void
setCompressionMethod
(int compressionMethod) Sets the fieldcompressionMethod
.void
setDirectoryToZip
(File directoryToZip) Sets the fielddirectoryToZip
.void
setDirToStart
(String dirToStart) Sets the fielddirToStart
.void
setFileCounter
(int fileCounter) Sets the fieldfileCounter
.void
setFileFilter
(FilenameFilter fileFilter) Sets the fieldfileFilter
.void
setFileLength
(long fileLength) Sets the fieldfileLength
.void
setZipFile
(File zipFile) Sets the fieldzipFile
.void
setZipFileComment
(String zipFileComment) Sets the fieldzipFileComment
.void
setZipFileName
(String zipFileName) Sets the fieldzipFileName
.void
setZipFileObj
(ZipFile zipFileObj) Sets the fieldzipFileObj
.void
setZipLevel
(int zipLevel) Sets the fieldzipLevel
.toString()
zip()
Zip the given files of this object
-
Constructor Details
-
Zipper
public Zipper()Instantiates a newZipper
object -
Zipper
Instantiates a newZipper
object- Parameters:
dirToZip
- the dir to zipzipFile
- the zip file
-
Zipper
Instantiates a newZipper
object- Parameters:
dirToZip
- the dir to zipzipFile
- the zip filefilter
- 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 newZipper
object- Parameters:
compressionMethod
- the compression methoddirectoryToZip
- the directory to zipdirToStart
- the directory to startfileCounter
- the file counterfileFilter
- the file name filterfileLength
- the file lengthzipFile
- the zip filezipFileComment
- the zip file commentzipFileName
- the zip file namezipFileObj
- the zip file objectzipLevel
- the compression level
-
-
Method Details
-
builder
-
getCompressionMethod
public int getCompressionMethod()Description copied from interface:ZipModel
Returns the fieldcompressionMethod
.- Specified by:
getCompressionMethod
in interfaceZipModel
- Returns:
- The field
compressionMethod
.
-
setCompressionMethod
public void setCompressionMethod(int compressionMethod) Description copied from interface:ZipModel
Sets the fieldcompressionMethod
.- Specified by:
setCompressionMethod
in interfaceZipModel
- Parameters:
compressionMethod
- ThecompressionMethod
to set
-
getDirectoryToZip
Description copied from interface:ZipModel
Returns the fielddirectoryToZip
.- Specified by:
getDirectoryToZip
in interfaceZipModel
- Returns:
- The field
directoryToZip
.
-
setDirectoryToZip
Description copied from interface:ZipModel
Sets the fielddirectoryToZip
.- Specified by:
setDirectoryToZip
in interfaceZipModel
- Parameters:
directoryToZip
- ThedirectoryToZip
to set
-
getDirToStart
Description copied from interface:ZipModel
Returns the fielddirToStart
.- Specified by:
getDirToStart
in interfaceZipModel
- Returns:
- The field
dirToStart
.
-
setDirToStart
Description copied from interface:ZipModel
Sets the fielddirToStart
.- Specified by:
setDirToStart
in interfaceZipModel
- Parameters:
dirToStart
- ThedirToStart
to set
-
getFileCounter
public int getFileCounter()Description copied from interface:ZipModel
Returns the fieldfileCounter
.- Specified by:
getFileCounter
in interfaceZipModel
- Returns:
- The field
fileCounter
.
-
setFileCounter
public void setFileCounter(int fileCounter) Description copied from interface:ZipModel
Sets the fieldfileCounter
.- Specified by:
setFileCounter
in interfaceZipModel
- Parameters:
fileCounter
- ThefileCounter
to set
-
getFileFilter
Description copied from interface:ZipModel
Returns the fieldfileFilter
.- Specified by:
getFileFilter
in interfaceZipModel
- Returns:
- The field
fileFilter
.
-
setFileFilter
Description copied from interface:ZipModel
Sets the fieldfileFilter
.- Specified by:
setFileFilter
in interfaceZipModel
- Parameters:
fileFilter
- ThefileFilter
to set
-
getFileLength
public long getFileLength()Description copied from interface:ZipModel
Returns the fieldfileLength
.- Specified by:
getFileLength
in interfaceZipModel
- Returns:
- The field
fileLength
.
-
setFileLength
public void setFileLength(long fileLength) Description copied from interface:ZipModel
Sets the fieldfileLength
.- Specified by:
setFileLength
in interfaceZipModel
- Parameters:
fileLength
- ThefileLength
to set
-
getZipFile
Description copied from interface:ZipModel
Returns the fieldzipFile
.- Specified by:
getZipFile
in interfaceZipModel
- Returns:
- The field
zipFile
.
-
setZipFile
Description copied from interface:ZipModel
Sets the fieldzipFile
.- Specified by:
setZipFile
in interfaceZipModel
- Parameters:
zipFile
- ThezipFile
to set
-
getZipFileComment
Description copied from interface:ZipModel
Returns the fieldzipFileComment
.- Specified by:
getZipFileComment
in interfaceZipModel
- Returns:
- The field
zipFileComment
.
-
setZipFileComment
Description copied from interface:ZipModel
Sets the fieldzipFileComment
.- Specified by:
setZipFileComment
in interfaceZipModel
- Parameters:
zipFileComment
- ThezipFileComment
to set
-
getZipFileName
Description copied from interface:ZipModel
Returns the fieldzipFileName
.- Specified by:
getZipFileName
in interfaceZipModel
- Returns:
- The field
zipFileName
.
-
setZipFileName
Description copied from interface:ZipModel
Sets the fieldzipFileName
.- Specified by:
setZipFileName
in interfaceZipModel
- Parameters:
zipFileName
- ThezipFileName
to set
-
getZipFileObj
Description copied from interface:ZipModel
Returns the fieldzipFileObj
.- Specified by:
getZipFileObj
in interfaceZipModel
- Returns:
- The field
zipFileObj
.
-
setZipFileObj
Description copied from interface:ZipModel
Sets the fieldzipFileObj
.- Specified by:
setZipFileObj
in interfaceZipModel
- Parameters:
zipFileObj
- ThezipFileObj
to set
-
getZipLevel
public int getZipLevel()Description copied from interface:ZipModel
Returns the fieldzipLevel
.- Specified by:
getZipLevel
in interfaceZipModel
- Returns:
- The field
zipLevel
.
-
setZipLevel
public void setZipLevel(int zipLevel) Description copied from interface:ZipModel
Sets the fieldzipLevel
.- Specified by:
setZipLevel
in interfaceZipModel
- Parameters:
zipLevel
- ThezipLevel
to set
-
toBuilder
-
toString
-
zip
Zip the given files of this object- Returns:
- the optional with the possibles errors
-