| Modifier and Type | Class and Description |
|---|---|
| public static class | Zip.ArchiveState
Holds the up-to-date status and the out-of-date resources of the original archive. |
| public static class | Zip.Duplicate
Possible behaviors when a duplicate file is added: "add", "preserve" or "fail" |
| public static class | Zip.UnicodeExtraField
Policy for creation of Unicode extra fields: never, always or not-encodeable. |
| public static class | Zip.WhenEmpty
Possible behaviors when there are no matching files for the task: "fail", "skip", or "create". |
| public static class | Zip.Zip64ModeAttribute
The choices for Zip64 extensions. |
| Modifier and Type | Field and Description |
|---|---|
| protected Hashtable | |
| private final List | |
| private boolean | addingNewFiles
true when we are adding new files into the Zip file, as opposed to adding back the unchanged files |
| protected String | |
| private File | |
| private static final int | |
| private String | comment
Comment for the archive. |
| private Zip. | createUnicodeExtraFields
Whether to add unicode extra fields. |
| private static final ThreadLocal | |
| private boolean | |
| private boolean | |
| protected boolean | doubleFilePass
If this flag is true, execute() will run most operations twice,
the first time with |
| private boolean | |
| protected String | |
| private static final long | |
| protected String | |
| private String | encoding
Encoding to use for filenames, defaults to the platform's default encoding. |
| protected Hashtable | |
| private boolean | fallBackToUTF8
Whether to fall back to UTF-8 if a name cannot be encoded using the specified encoding. |
| private static final FileUtils | |
| private final List | |
| private String | |
| private final List | |
| private static final ThreadLocal | |
| private boolean | keepCompression
Whether the original compression of entries coming from a ZIP archive should be kept (for example when updating an archive). |
| private int | |
| private static final ResourceUtils. | |
| private static final ResourceSelector | |
| private long | |
| private boolean | preserve0Permissions
Assume 0 Unix mode is intentional. |
| private final List | |
| private boolean | roundUp
Whether the file modification times will be rounded up to the next even number of seconds. |
| private static final int | |
| private boolean | |
| protected boolean | skipWriting
whether the methods should just perform some sort of dry-run. |
| private boolean | |
| private boolean | useLanguageEncodingFlag
Whether to set the language encoding flag when creating the archive. |
| private Zip. | zip64Mode
Whether to enable Zip64 extensions. |
| private static final int | ZIP_FILE_TIMESTAMP_GRANULARITY
The granularity of timestamps inside a ZIP archive. |
| protected File | |
| private ZipScanner |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(final ResourceCollection
the resources to archive a)Add a collection of resources to be archived. |
| private void | addDirectoryResource(final Resource r, String name, final String prefix, final File base, final ZipOutputStream zOut, final int defaultDirMode, final int thisDirMode)
Add a directory entry to the archive using a specified Unix-mode and the default mode for its parent directories (if necessary). |
| public void | |
| protected final void | addParentDirs(final File
the base directory to use (may be null) baseDir, final String the entry name to create directories from entry, final ZipOutputStream the stream to write to zOut, final String a prefix to place on the created entries prefix, final int the directory mode dirMode)Ensure all parent dirs of a given entry have been added. |
| private void | addResource(final Resource r, final String name, final String prefix, final ZipOutputStream zOut, final int mode, final ZipFile zf, final File fromArchive)
Add a file entry. |
| protected final void | addResources(final FileSet
may give additional information like fullpath or
permissions. fileset, final Resource[] the resources to add resources, final ZipOutputStream the stream to write to zOut)Add the given resources. |
| protected final void | addResources(final ResourceCollection
may give additional information like fullpath or
permissions. rc, final Resource[] the resources to add resources, final ZipOutputStream the stream to write to zOut)Add the given resources. |
| public void | addZipfileset(final ZipFileSet
the zipfileset to add set)Adds a set of files that can be read from an archive and be given a prefix/fullpath. |
| public void | |
| private void | |
| protected void | |
| private void | |
| protected boolean | Returns: true for historic reasonsthe zip file zipFile)Create an empty zip file |
| public void | |
| public void | |
| protected void | finalizeZipOutputStream(final ZipOutputStream
the zip output stream zOut)method for subclasses to override |
| public String | |
| public Zip. | |
| protected final ZipExtraField[] | Returns: ZipExtraField[]Provides the extra fields for the zip entry currently being added to the archive - if any. |
| public File | |
| public String | |
| public boolean | Returns: booleanWhether to fall back to UTF-8 if a name cannot be encoded using the specified encoding. |
| public int | |
| public String | Returns: StringThe file modification time previously provided to
|
| protected Zip. | Returns: an array of resources to add for each fileset passed in as well as a flag that indicates whether the archive is uptodate.The filesets to grab resources from rcs, final File intended archive file (may or may not exist) zipFile, boolean whether we already know that the archive is
out-of-date. Subclasses overriding this method are supposed to
set this value correctly in their call to
needsUpdate)super.getResourcesToAdd.Collect the resources that are newer than the corresponding entries (or missing) in the original archive. |
| public boolean | |
| protected Zip. | Returns: an array of resources to add for each fileset passed in as well as a flag that indicates whether the archive is uptodate.The resource collections to grab resources from rcs, final File intended archive file (may or may not exist) zipFile, final boolean whether we already know that the archive is
out-of-date. Subclasses overriding this method are supposed to
set this value correctly in their call to
needsUpdate)super.getResourcesToAdd.Collect the resources that are newer than the corresponding entries (or missing) in the original archive. |
| protected Zip. | Returns: an array of resources to add for each fileset passed in as well as a flag that indicates whether the archive is uptodate.The filesets to grab resources from filesets, final File intended archive file (may or may not exist) zipFile, boolean whether we already know that the archive is
out-of-date. Subclasses overriding this method are supposed to
set this value correctly in their call to
needsUpdate)super.getResourcesToAdd.Collect the resources that are newer than the corresponding entries (or missing) in the original archive. |
| private int | getUnixMode(final Resource r, final ZipFile zf, final int defaultMode)
Determine a Resource's Unix mode or return the given default value if not available. |
| public boolean | |
| public Zip. | |
| private synchronized ZipScanner | |
| protected Resource[][] | Returns: the resources includedan array of resource collections rcs)Fetch all included and not excluded resources from the collections. |
| protected Resource[][] | Returns: the resources includedan array of filesets filesets)Fetch all included and not excluded resources from the sets. |
| protected boolean | Returns: true if executeMain has written to the zip file.Get the value of the updatedFile attribute. |
| protected void | initZipOutputStream(final ZipOutputStream
the zip output stream zOut)method for subclasses to override |
| protected final boolean | Returns: true if adding new filesIndicates if the task is adding new files into the archive as opposed to copying back unchanged files from the backup copy |
| public boolean | Returns: true if the files are to be compressedWhether we want to compress the files or only store them; |
| protected static final boolean | |
| protected final boolean | |
| public boolean | |
| protected void | logWhenWriting(final String
String msg, final int int level)Logs a message at the given output level, but only if this is the pass that will actually create the archive. |
| private void | |
| private void | |
| private File | |
| public void | |
| protected Resource[] | Returns: the filters resourcesthe resources to filter orig)Drops all non-directory resources from the given array. |
| protected Resource[] | Returns: the filters resourcesthe resources to filter orig)Drops all non-file resources from the given array. |
| private Resource[] | |
| protected Resource[] | Returns: the filters resourcesthe resources to filter orig, final ResourceSelector ResourceSelector selector)Drops all resources from the given array that are not selected |
| public void | |
| public void | |
| public void | setCompress(final boolean
if true, compress the files c)Whether we want to compress the files or only store them; optional, default=true; |
| public void | setCreateUnicodeExtraFields(final Zip.
boolean bWhether Unicode extra fields will be created. |
| protected final void | setCurrentExtraFields(final ZipExtraField[]
ZipExtraField[] extra)Sets the extra fields for the zip entry currently being added to the archive - if any. |
| public void | |
| public void | setDuplicate(final Zip.
a dfDuplicate enumerated valueSets behavior for when a duplicate file is about to be added -
one of |
| public void | setEncoding(final String
the encoding name encoding)Encoding to use for filenames, defaults to the platform's default encoding. |
| public void | setFallBackToUTF8(final boolean
boolean b)Whether to fall back to UTF-8 if a name cannot be encoded using the specified encoding. |
| public void | |
| public void | setFilesonly(final boolean
if true, emulate sun's jar by not adding parent directories f)If true, emulate Sun's jar utility by not adding parent directories; optional, defaults to false. |
| public void | setKeepCompression(final boolean
if true, keep the original compression keep)Whether the original compression of entries coming from a ZIP archive should be kept (for example when updating an archive). |
| public void | |
| public void | setModificationtime(String
Milliseconds since 1970-01-01 00:00, or
time)YYYY-MM-DD{T/ }HH:MM[:SS[.SSS]][ ][±ZZ[[:]ZZ]], or
MM/DD/YYYY HH:MM[:SS] {AM/PM}, where {a/b} indicates
that you must choose one of a or b, and [c] indicates that you
may use or omit c. ±ZZZZ is the timezone offset, and may be
literally "Z" to mean GMT.Set all stored file modification times to |
| public void | |
| public void | setRoundUp(final boolean
a r)boolean valueWhether the file modification times will be rounded up to the next even number of seconds. |
| public void | setUpdate(final boolean
if true, updates an existing zip file c)If true, updates an existing file, otherwise overwrite any existing one; optional defaults to false. |
| public void | |
| public void | setWhenempty(final Zip.
a weWhenEmpty enumerated valueSets behavior of the task when no files match. |
| public void | |
| public void | setZipfile(final File
the path of the zipFile zipFile)
Deprecated
since 1.5.x.
Use setDestFile(File) instead.
This is the name/location of where to
create the .zip file.
|
| protected void | zipDir(final File
the directory to add to the archive dir, final ZipOutputStream the stream to write to zOut, final String the name this entry shall have in the archive vPath, final int the Unix permissions to set. mode)Add a directory to the zip stream. |
| protected void | zipDir(final File
the directory to add to the archive dir, final ZipOutputStream the stream to write to zOut, final String the name this entry shall have in the archive vPath, final int the Unix permissions to set. mode, final ZipExtraField[] ZipExtraFields to add extra)Add a directory to the zip stream. |
| protected void | zipDir(final Resource
the directory to add to the archive dir, final ZipOutputStream the stream to write to zOut, final String the name this entry shall have in the archive vPath, final int the Unix permissions to set. mode, final ZipExtraField[] ZipExtraFields to add extra)Add a directory to the zip stream. |
| protected void | zipFile(final InputStream
the stream to read data for the entry from. The
caller of the method is responsible for closing the stream. in, final ZipOutputStream the stream to write to. zOut, final String the name this entry shall have in the archive. vPath, final long last modification time for the entry. lastModified, final File the original archive we are copying this
entry from, will be null if we are not copying from an archive. fromArchive, final int the Unix permissions to set. mode)Adds a new entry to the archive, takes care of duplicates as well. |
| protected final void | zipFile(final InputStream
the stream to read data for the entry from. The
caller of the method is responsible for closing the stream. in, final ZipOutputStream the stream to write to. zOut, final String the name this entry shall have in the archive. vPath, final long last modification time for the entry. lastModified, final File the original archive we are copying this
entry from, will be null if we are not copying from an archive. fromArchive, final int the Unix permissions to set. mode, final ZipExtraField[] ZipExtraFields to add extra)Adds a new entry to the archive, takes care of duplicates as well. |
| protected void | zipFile(final File
the file to add to the archive file, final ZipOutputStream the stream to write to zOut, final String the name this entry shall have in the archive vPath, final int the Unix permissions to set. mode)Method that gets called when adding from |