Modifier and Type | Method and Description |
---|---|
static void |
unzipArchive(File zipArchive,
File unzipRootFolder)
Calls
unzipArchive(URL, File) converting the File-parameter zipArchive to an url. |
static void |
unzipArchive(URL zipArchive,
File unzipRootFolder)
Unzip the given archive into the given folder.
|
static void |
unzipArchiveIfModified(File zipArchive,
File unzipRootFolder)
Calls
unzipArchiveIfModified(URL, File) converting the File-parameter zipArchive to an url. |
static void |
unzipArchiveIfModified(URL zipArchive,
File unzipRootFolder)
Unzip the given archive into the given folder, if the archive was modified
after being unzipped the last time by this method.
|
static void |
zipFilesRecursively(File zipOutputFile,
File[] files,
File entryRoot)
Recursively zips all given files to a zipFile defined by zipOutputFile.
|
static void |
zipFilesRecursively(File zipOutputFile,
File[] files,
File entryRoot,
ProgressMonitor monitor)
Recursively zips all given files to a zipFile defined by zipOutputFile.
|
static void |
zipFilesRecursively(ZipOutputStream out,
File zipOutputFile,
File[] files,
File entryRoot)
Recursively writes all found files as entries into the given ZipOutputStream.
|
static void |
zipFilesRecursively(ZipOutputStream out,
File zipOutputFile,
File[] files,
File entryRoot,
ProgressMonitor monitor)
Recursively writes all found files as entries into the given ZipOutputStream.
|
static void |
zipFolder(File zipOutputFile,
File zipInputFolder)
Recursively zips all entries of the given zipInputFolder to
a zipFile defined by zipOutputFile.
|
static void |
zipFolder(File zipOutputFile,
File zipInputFolder,
ProgressMonitor monitor)
Recursively zips all entries of the given zipInputFolder to
a zipFile defined by zipOutputFile.
|
public static void zipFolder(File zipOutputFile, File zipInputFolder) throws IOException
zipOutputFile
- The file to write to (will be deleted if existent).zipInputFolder
- The inputFolder to zip.IOException
- in case of an I/O error.public static void zipFolder(File zipOutputFile, File zipInputFolder, ProgressMonitor monitor) throws IOException
zipOutputFile
- The file to write to (will be deleted if existent).zipInputFolder
- The inputFolder to zip.monitor
- an optional monitor for progress feedback (can be null
).IOException
- in case of an I/O error.public static void zipFilesRecursively(File zipOutputFile, File[] files, File entryRoot) throws IOException
zipOutputFile
- The file to write to (will be deleted if existent).files
- The files to zip (optional, defaults to all files recursively). It must not be null
,
if entryRoot
is null
.entryRoot
- The root folder of all entries. Entries in subfolders will be
added relative to this. If entryRoot==null
, all given files will be
added without any path (directly into the zip's root). entryRoot
and files
must not
both be null
at the same time.IOException
- in case of an I/O error.public static void zipFilesRecursively(File zipOutputFile, File[] files, File entryRoot, ProgressMonitor monitor) throws IOException
zipOutputFile
- The file to write to (will be deleted if existent).files
- The files to zip (optional, defaults to all files recursively). It must not be null
,
if entryRoot
is null
.entryRoot
- The root folder of all entries. Entries in subfolders will be
added relative to this. If entryRoot==null
, all given files will be
added without any path (directly into the zip's root). entryRoot
and files
must not
both be null
at the same time.monitor
- an optional monitor for progress feedback (can be null
).IOException
- in case of an I/O error.public static void zipFilesRecursively(ZipOutputStream out, File zipOutputFile, File[] files, File entryRoot) throws IOException
out
- The ZipOutputStream to write to.zipOutputFile
- the output zipFile. optional. if it is null, this method cannot check whether
your current output file is located within the zipped directory tree. You must not locate
your zip-output file within the source directory, if you leave this null
.files
- The files to zip (optional, defaults to all files recursively). It must not be null
,
if entryRoot
is null
.entryRoot
- The root folder of all entries. Entries in subfolders will be
added relative to this. If entryRoot==null
, all given files will be
added without any path (directly into the zip's root). entryRoot
and files
must not
both be null
at the same time.IOException
- in case of an I/O error.public static void zipFilesRecursively(ZipOutputStream out, File zipOutputFile, File[] files, File entryRoot, ProgressMonitor monitor) throws IOException
out
- The ZipOutputStream to write to.zipOutputFile
- the output zipFile. optional. if it is null, this method cannot check whether
your current output file is located within the zipped directory tree. You must not locate
your zip-output file within the source directory, if you leave this null
.files
- The files to zip (optional, defaults to all files recursively). It must not be null
,
if entryRoot
is null
.entryRoot
- The root folder of all entries. Entries in subfolders will be
added relative to this. If entryRoot==null
, all given files will be
added without any path (directly into the zip's root). entryRoot
and files
must not
both be null
at the same time.monitor
- an optional monitor for progress feedback (can be null
).IOException
- in case of an I/O error.public static void unzipArchiveIfModified(File zipArchive, File unzipRootFolder) throws IOException
unzipArchiveIfModified(URL, File)
converting the File-parameter zipArchive to an url.IOException
unzipArchiveIfModified(URL, File).
public static void unzipArchiveIfModified(URL zipArchive, File unzipRootFolder) throws IOException
The current implementation
of this method creates a file named ".archive.properties" inside the
unzipRootFolder
and stores the zipArchive
's file size and
last-modified-timestamp to decide whether a future call to this method needs
to unzip the data again.
Note, that this method deletes the unzipRootFolder
prior to unzipping
in order to guarantee that content which was removed from the zipArchive
is not existing
in the unzipRootFolder
anymore, too.
zipArchive
- The zip file to unzip.unzipRootFolder
- The folder to unzip to.IOException
- in case of an I/O error.public static void unzipArchive(URL zipArchive, File unzipRootFolder) throws IOException
zipArchive
- The zip file to unzip.unzipRootFolder
- The folder to unzip to.IOException
- in case of an I/O error.public static void unzipArchive(File zipArchive, File unzipRootFolder) throws IOException
unzipArchive(URL, File)
converting the File-parameter zipArchive to an url.IOException
unzipArchive(URL, File).
Copyright © 2013-2014. All Rights Reserved.