public class Zipper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.io.FileOutputStream |
fos |
private java.lang.String |
fullPathToZipToCreate |
private java.lang.String |
innerFolderName |
private static Log |
logger |
private java.util.zip.ZipOutputStream |
zos |
Constructor and Description |
---|
Zipper(java.lang.String fullPathToZipToCreate) |
Zipper(java.lang.String fullPathToZipToCreate,
java.lang.String innerFolderName) |
Modifier and Type | Method and Description |
---|---|
void |
addToZip(java.net.URL file) |
void |
addToZip(java.net.URL file,
java.lang.String innerFolder) |
private void |
getAllFiles(java.io.File dir,
java.util.List<java.net.URL> fileList) |
java.nio.file.Path |
getZipFromDirectory(java.io.File sourceFolder) |
private java.nio.file.Path |
getZipFromDirectory(java.io.File sourceFolder,
java.lang.String outputFileName) |
java.nio.file.Path |
getZipFromFile(java.net.URL file) |
java.nio.file.Path |
processAddedFilesAndZip() |
private static Log logger
private java.io.FileOutputStream fos
private java.util.zip.ZipOutputStream zos
private java.lang.String fullPathToZipToCreate
private java.lang.String innerFolderName
public Zipper(java.lang.String fullPathToZipToCreate) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public Zipper(java.lang.String fullPathToZipToCreate, java.lang.String innerFolderName) throws java.io.IOException
java.io.IOException
public java.nio.file.Path getZipFromFile(java.net.URL file) throws java.io.IOException
aspectPath
- file
- java.io.IOException
public java.nio.file.Path getZipFromDirectory(java.io.File sourceFolder) throws java.io.IOException
sourceFolder
- java.io.IOException
private java.nio.file.Path getZipFromDirectory(java.io.File sourceFolder, java.lang.String outputFileName) throws java.io.IOException
sourceFolder
- outputFileName
- java.io.IOException
private void getAllFiles(java.io.File dir, java.util.List<java.net.URL> fileList) throws java.net.MalformedURLException
dir
- fileList
- java.net.MalformedURLException
public java.nio.file.Path processAddedFilesAndZip() throws java.io.IOException
directoryToZip
- outputFileName
- fileList
- java.io.IOException
public void addToZip(java.net.URL file) throws java.io.FileNotFoundException, java.io.IOException
file
- zos
- java.io.FileNotFoundException
java.io.IOException
public void addToZip(java.net.URL file, java.lang.String innerFolder) throws java.io.FileNotFoundException, java.io.IOException
file
- zos
- java.io.FileNotFoundException
java.io.IOException