Package com.axemble.vdoc.sdk.utils
Class ZipUtils
java.lang.Object
com.axemble.vdoc.sdk.utils.ZipUtils
A collection of methods to deal with ZIP API.
- Since:
- 1.0, 08/01/2009
- Author:
- vlygeros
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanunzipFile(File file, ZipUtils.ZipListener listener) Allows to uncompress a file using a listener.static booleanunzipFile(InputStream inputStream, ZipUtils.ZipListener listener) Allows to uncompress a InputStream using a listener.static booleanzipDirectory(File directory, OutputStream outputStream) Allows to compress all the files within a specified directory.static booleanzipFile(File file, OutputStream outputStream) Allows to compress a single file.static booleanzipFiles(Collection files, OutputStream outputStream) Allows to compress files and directories.
-
Constructor Details
-
ZipUtils
public ZipUtils()
-
-
Method Details
-
zipDirectory
Allows to compress all the files within a specified directory.- Parameters:
directory- The directory to compress.outputStream- The OutputStream object.- Returns:
- true if succeed, false otherwise.
- Throws:
IOException- Any IOException.
-
zipFile
Allows to compress a single file.- Parameters:
file- The file to compress.outputStream- The OutputStream object.- Returns:
- true if succeed, false otherwise.
- Throws:
IOException- Any IOException.
-
zipFiles
Allows to compress files and directories.- Parameters:
files- The list of the files to compress.outputStream- The OutputStream object.- Returns:
- true if succeed, false otherwise.
- Throws:
IOException- Any IOException.
-
unzipFile
public static boolean unzipFile(InputStream inputStream, ZipUtils.ZipListener listener) throws IOException Allows to uncompress a InputStream using a listener.- Parameters:
inputStream- The InputStream to uncompress.listener- TheZipUtils.ZipListenerobject.- Returns:
- true if succeed, false otherwise.
- Throws:
IOException- Any IOException.
-
unzipFile
Allows to uncompress a file using a listener.- Parameters:
file- The file to unzip.listener- TheZipUtils.ZipListenerobject.- Returns:
- true if succeed, false otherwise.
- Throws:
IOException- Any IOException.
-