Package org.craftercms.commons.zip
Class ZipUtils
java.lang.Object
org.craftercms.commons.zip.ZipUtils
Utility for zipping files.
- Author:
- Jose Vega, Alfonso Vásquez
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
unZipFiles
(File zipFile, File outputFolder) Unzips a zip file into an output folder.static void
unZipFiles
(InputStream inputStream, File outputFolder) Unzips a zip from an input stream into an output folder.static void
Zips a collection of files to a destination zip file.static void
zipFiles
(List<File> files, OutputStream outputStream) Zips a collection of files to a destination zip output stream.
-
Constructor Details
-
ZipUtils
public ZipUtils()
-
-
Method Details
-
zipFiles
Zips a collection of files to a destination zip output stream.- Parameters:
files
- A collection of files and directoriesoutputStream
- The output stream of the destination zip file- Throws:
FileNotFoundException
IOException
-
zipFiles
Zips a collection of files to a destination zip file.- Parameters:
files
- A collection of files and directorieszipFile
- The path of the destination zip file- Throws:
FileNotFoundException
IOException
-
unZipFiles
Unzips a zip from an input stream into an output folder.- Parameters:
inputStream
- the zip input streamoutputFolder
- the output folder where the files- Throws:
IOException
-
unZipFiles
Unzips a zip file into an output folder.- Parameters:
zipFile
- the zip fileoutputFolder
- the output folder where the files- Throws:
IOException
-