From cd67785ad9d2bcba5d774dab09c845e198b94746 Mon Sep 17 00:00:00 2001
From: Peter Reilly For a list of possible values see http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html.overwrite
overwrite the file
* with the new file
* Default for zip tasks is keep
+ * @param df a Duplicate
enumerated value
*/
public void setDuplicate(Duplicate df) {
duplicate = df.getValue();
@@ -249,6 +260,10 @@ public class Zip extends MatchingTask {
* "fail", "skip", or "create".
*/
public static class WhenEmpty extends EnumeratedAttribute {
+ /**
+ * The string values for the enumerated value
+ * @return the values
+ */
public String[] getValues() {
return new String[] {"fail", "skip", "create"};
}
@@ -262,6 +277,7 @@ public class Zip extends MatchingTask {
* (make an archive with no entries).
* Default for zip tasks is skip
;
* for jar tasks, create
.
+ * @param we a WhenEmpty
enumerated value
*/
public void setWhenempty(WhenEmpty we) {
emptyBehavior = we.getValue();
@@ -273,6 +289,7 @@ public class Zip extends MatchingTask {
*
*
boolean
value
* @since Ant 1.6.2
*/
public void setRoundUp(boolean r) {
@@ -337,6 +355,7 @@ public class Zip extends MatchingTask {
/**
* validate and build
+ * @throws BuildException on error
*/
public void execute() throws BuildException {
@@ -350,6 +369,11 @@ public class Zip extends MatchingTask {
}
}
+ /**
+ * Build the zip file.
+ * This is called twice if doubleFilePass is true.
+ * @throws BuildException on error
+ */
public void executeMain() throws BuildException {
if (baseDir == null && filesets.size() == 0
@@ -571,6 +595,7 @@ public class Zip extends MatchingTask {
/**
* Indicates if the task is adding new files into the archive as opposed to
* copying back unchanged files from the backup copy
+ * @return true if adding new files
*/
protected final boolean isAddingNewFiles() {
return addingNewFiles;
@@ -583,6 +608,7 @@ public class Zip extends MatchingTask {
* permissions.
* @param resources the resources to add
* @param zOut the stream to write to
+ * @throws IOException on error
*
* @since Ant 1.5.2
*/
@@ -699,6 +725,9 @@ public class Zip extends MatchingTask {
/**
* method for subclasses to override
+ * @param zOut the zip output stream
+ * @throws IOException on output error
+ * @throws BuildException on other errors
*/
protected void initZipOutputStream(ZipOutputStream zOut)
throws IOException, BuildException {
@@ -706,6 +735,9 @@ public class Zip extends MatchingTask {
/**
* method for subclasses to override
+ * @param zOut the zip output stream
+ * @throws IOException on output error
+ * @throws BuildException on other errors
*/
protected void finalizeZipOutputStream(ZipOutputStream zOut)
throws IOException, BuildException {
@@ -713,8 +745,9 @@ public class Zip extends MatchingTask {
/**
* Create an empty zip file
- *
+ * @param zipFile the zip file
* @return true for historic reasons
+ * @throws BuildException on error
*/
protected boolean createEmptyZip(File zipFile) throws BuildException {
// In this case using java.util.zip will not work
@@ -926,7 +959,8 @@ public class Zip extends MatchingTask {
* Fetch all included and not excluded resources from the sets.
*
* Included directories will precede included files.
- * + * @param filesets an array of filesets + * @return the resources included * @since Ant 1.5.2 */ protected Resource[][] grabResources(FileSet[] filesets) { @@ -964,6 +998,12 @@ public class Zip extends MatchingTask { } /** + * Add a directory to the zip stream. + * @param dir the directort to add to the archive + * @param zOut the stream to write to + * @param vPath the name this entry shall have in the archive + * @param mode the Unix permissions to set. + * @throws IOException on error * @since Ant 1.5.2 */ protected void zipDir(File dir, ZipOutputStream zOut, String vPath, @@ -1009,6 +1049,7 @@ public class Zip extends MatchingTask { * @param mode the Unix permissions to set. * * @since Ant 1.5.2 + * @throws IOException on error */ protected void zipFile(InputStream in, ZipOutputStream zOut, String vPath, long lastModified, File fromArchive, int mode) @@ -1101,6 +1142,7 @@ public class Zip extends MatchingTask { * @param zOut the stream to write to * @param vPath the name this entry shall have in the archive * @param mode the Unix permissions to set. + * @throws IOException on error * * @since Ant 1.5.2 */ @@ -1125,7 +1167,12 @@ public class Zip extends MatchingTask { /** * Ensure all parent dirs of a given entry have been added. - * + * @param baseDir the base directory to use (may be null) + * @param entry the entry name to create directories from + * @param zOut the stream to write to + * @param prefix a prefix to place on the created entries + * @param dirMode the directory mode + * @throws IOException on error * @since Ant 1.5.2 */ protected final void addParentDirs(File baseDir, String entry, @@ -1208,6 +1255,8 @@ public class Zip extends MatchingTask { } /** + * Check is the resource arrays are empty. + * @param r the arrays to check * @return true if all individual arrays are empty * * @since Ant 1.5.2 @@ -1223,7 +1272,8 @@ public class Zip extends MatchingTask { /** * Drops all non-file resources from the given array. - * + * @param orig the resources to filter + * @return the filters resources * @since Ant 1.6 */ protected Resource[] selectFileResources(Resource[] orig) { @@ -1254,6 +1304,9 @@ public class Zip extends MatchingTask { * "add", "preserve" or "fail" */ public static class Duplicate extends EnumeratedAttribute { + /** + * @see EnumeratedAttribute#getValues() + */ public String[] getValues() { return new String[] {"add", "preserve", "fail"}; } @@ -1274,10 +1327,18 @@ public class Zip extends MatchingTask { resourcesToAdd = r; } + /** + * Return the outofdate status. + * @return the outofdate status + */ public boolean isOutOfDate() { return outOfDate; } + /** + * Get the resources to add. + * @return the resources to add + */ public Resource[][] getResourcesToAdd() { return resourcesToAdd; }