From c89a66172df55665b27e2ef3626453d8958f9767 Mon Sep 17 00:00:00 2001
From: Stefan Bodewig
Starting with Ant 1.6, <zip> can store Unix permissions +
Starting with Ant 1.5.2, <zip> can store Unix permissions inside the archive (see description of the filemode and dirmode attributes for <zipfileset>). Unfortunately there is no portable way to store these permissions. @@ -196,14 +196,14 @@ those listed below.
Included directories will preceede included files.
* - * @since Ant 1.6 + * @since Ant 1.5.2 */ protected Resource[][] grabResources(FileSet[] filesets) { Resource[][] result = new Resource[filesets.length][]; @@ -828,7 +828,7 @@ public class Zip extends MatchingTask { } /** - * @since Ant 1.6 + * @since Ant 1.5.2 */ protected void zipDir(File dir, ZipOutputStream zOut, String vPath, int mode) @@ -872,7 +872,7 @@ public class Zip extends MatchingTask { * entry from, will be null if we are not copying from an archive. * @param mode the Unix permissions to set. * - * @since Ant 1.6 + * @since Ant 1.5.2 */ protected void zipFile(InputStream in, ZipOutputStream zOut, String vPath, long lastModified, File fromArchive, int mode) @@ -969,7 +969,7 @@ public class Zip extends MatchingTask { * @param vPath the name this entry shall have in the archive * @param mode the Unix permissions to set. * - * @since Ant 1.6 + * @since Ant 1.5.2 */ protected void zipFile(File file, ZipOutputStream zOut, String vPath, int mode) @@ -991,7 +991,7 @@ public class Zip extends MatchingTask { /** * Ensure all parent dirs of a given entry have been added. * - * @since Ant 1.6 + * @since Ant 1.5.2 */ protected final void addParentDirs(File baseDir, String entry, ZipOutputStream zOut, String prefix, @@ -1075,7 +1075,7 @@ public class Zip extends MatchingTask { /** * @return true if all individual arrays are empty * - * @since Ant 1.6 + * @since Ant 1.5.2 */ protected final static boolean isEmpty(Resource[][] r) { for (int i = 0; i < r.length; i++) { diff --git a/src/main/org/apache/tools/ant/types/ZipFileSet.java b/src/main/org/apache/tools/ant/types/ZipFileSet.java index 0cd5040b5..a6280be31 100644 --- a/src/main/org/apache/tools/ant/types/ZipFileSet.java +++ b/src/main/org/apache/tools/ant/types/ZipFileSet.java @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2001-2002 The Apache Software Foundation. All rights + * Copyright (c) 2001-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -83,7 +83,7 @@ public class ZipFileSet extends FileSet { /** * Default value for the dirmode attribute. * - * @since Ant 1.6 + * @since Ant 1.5.2 */ public static final int DEFAULT_DIR_MODE = UnixStat.DIR_FLAG | UnixStat.DEFAULT_DIR_PERM; @@ -91,7 +91,7 @@ public class ZipFileSet extends FileSet { /** * Default value for the filemode attribute. * - * @since Ant 1.6 + * @since Ant 1.5.2 */ public static final int DEFAULT_FILE_MODE = UnixStat.FILE_FLAG | UnixStat.DEFAULT_FILE_PERM; @@ -216,7 +216,7 @@ public class ZipFileSet extends FileSet { * other modes in the standard Unix fashion; * optional, default=0644 * - * @since Ant 1.6 + * @since Ant 1.5.2 */ public void setFileMode(String octalString) { this.fileMode = @@ -224,7 +224,7 @@ public class ZipFileSet extends FileSet { } /** - * @since Ant 1.6 + * @since Ant 1.5.2 */ public int getFileMode() { return fileMode; diff --git a/src/main/org/apache/tools/ant/util/SourceSelector.java b/src/main/org/apache/tools/ant/util/ResourceUtils.java similarity index 99% rename from src/main/org/apache/tools/ant/util/SourceSelector.java rename to src/main/org/apache/tools/ant/util/ResourceUtils.java index 9f00be7d6..4c7b57cb1 100644 --- a/src/main/org/apache/tools/ant/util/SourceSelector.java +++ b/src/main/org/apache/tools/ant/util/ResourceUtils.java @@ -68,7 +68,7 @@ import java.util.Vector; * @author Antoine Levy-Lambert * @since Ant 1.5.2 */ -public class SourceSelector { +public class ResourceUtils { /** { * tells which source files should be reprocessed based on the diff --git a/src/main/org/apache/tools/ant/util/SourceFileScanner.java b/src/main/org/apache/tools/ant/util/SourceFileScanner.java index 7a054a61c..56f90aa60 100644 --- a/src/main/org/apache/tools/ant/util/SourceFileScanner.java +++ b/src/main/org/apache/tools/ant/util/SourceFileScanner.java @@ -115,8 +115,8 @@ public class SourceFileScanner implements ResourceFactory { // build the list of sources which are out of date with // respect to the target Resource[] outofdate = - SourceSelector.selectOutOfDateSources(task, sourceresources, - mapper, this); + ResourceUtils.selectOutOfDateSources(task, sourceresources, + mapper, this); String[] result = new String[outofdate.length]; for (int counter=0; counter < outofdate.length; counter++) { result[counter] = outofdate[counter].getName(); diff --git a/src/main/org/apache/tools/zip/ZipEntry.java b/src/main/org/apache/tools/zip/ZipEntry.java index d563c2f78..ef7854b3d 100644 --- a/src/main/org/apache/tools/zip/ZipEntry.java +++ b/src/main/org/apache/tools/zip/ZipEntry.java @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2001-2002 The Apache Software Foundation. All rights + * Copyright (c) 2001-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -194,7 +194,7 @@ public class ZipEntry extends java.util.zip.ZipEntry { * Sets Unix permissions in a way that is understood by Info-Zip's * unzip command. * - * @since Ant 1.6 + * @since Ant 1.5.2 */ public void setUnixMode(int mode) { setExternalAttributes((mode << 16) @@ -212,7 +212,7 @@ public class ZipEntry extends java.util.zip.ZipEntry { * @return 0 (MS-DOS FAT) unless {@link #setUnixMode setUnixMode} * has been called, in which case 3 (Unix) will be returned. * - * @since Ant 1.6 + * @since Ant 1.5.2 */ public int getPlatform() { return platform; diff --git a/src/testcases/org/apache/tools/ant/util/SourceSelectorTest.java b/src/testcases/org/apache/tools/ant/util/ResourceUtilsTest.java similarity index 91% rename from src/testcases/org/apache/tools/ant/util/SourceSelectorTest.java rename to src/testcases/org/apache/tools/ant/util/ResourceUtilsTest.java index 18c0bc689..fe58e6322 100644 --- a/src/testcases/org/apache/tools/ant/util/SourceSelectorTest.java +++ b/src/testcases/org/apache/tools/ant/util/ResourceUtilsTest.java @@ -64,14 +64,14 @@ import java.io.File; import junit.framework.TestCase; /** - * Tests for org.apache.tools.ant.util.SourceSelector. + * Tests for org.apache.tools.ant.util.ResourceUtils. */ -public class SourceSelectorTest extends TestCase +public class ResourceUtilsTest extends TestCase implements ResourceFactory, FileNameMapper { private Echo taskINeedForLogging = new Echo(); - public SourceSelectorTest(String name) { + public ResourceUtilsTest(String name) { super(name); taskINeedForLogging.setProject(new Project()); } @@ -79,9 +79,9 @@ public class SourceSelectorTest extends TestCase public void testNoDuplicates() { Resource r = new Resource("samual vimes", true, 1, false); Resource[] toNew = - SourceSelector.selectOutOfDateSources(taskINeedForLogging, - new Resource[] {r}, - this, this); + ResourceUtils.selectOutOfDateSources(taskINeedForLogging, + new Resource[] {r}, + this, this); assertEquals(1, toNew.length); }