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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
unzipFile
(File file, ZipUtils.ZipListener listener) Allows to uncompress a file using a listener.static boolean
unzipFile
(InputStream inputStream, ZipUtils.ZipListener listener) Allows to uncompress a InputStream using a listener.static boolean
zipDirectory
(File directory, OutputStream outputStream) Allows to compress all the files within a specified directory.static boolean
zipFile
(File file, OutputStream outputStream) Allows to compress a single file.static boolean
zipFiles
(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.ZipListener
object.- 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.ZipListener
object.- Returns:
- true if succeed, false otherwise.
- Throws:
IOException
- Any IOException.
-