ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/types ZipFileSet.java
Date Fri, 06 Dec 2002 14:02:01 GMT
bodewig     2002/12/06 06:02:01

  Modified:    src/main/org/apache/tools/ant/types ZipFileSet.java
  Log:
  Some prelimnary commit for bug 6492 - I'm still trying to understand how Info-Zip stores
the permissions
  
  Revision  Changes    Path
  1.12      +53 -2     jakarta-ant/src/main/org/apache/tools/ant/types/ZipFileSet.java
  
  Index: ZipFileSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/ZipFileSet.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ZipFileSet.java	25 Jul 2002 15:21:21 -0000	1.11
  +++ ZipFileSet.java	6 Dec 2002 14:02:01 -0000	1.12
  @@ -58,6 +58,7 @@
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.DirectoryScanner;
   import org.apache.tools.ant.Project;
  +import org.apache.tools.zip.UnixStat;
   
   /**
    * A ZipFileSet is a FileSet with extra attributes useful in the context of
  @@ -83,13 +84,25 @@
       private String prefix         = "";
       private String fullpath       = "";
       private boolean hasDir        = false;
  +    private int fileMode =  UnixStat.FILE_FLAG | UnixStat.DEFAULT_FILE_PERM;
  +    private int dirMode =   UnixStat.DIR_FLAG  | UnixStat.DEFAULT_DIR_PERM;
   
       public ZipFileSet() {
  -      super();
  +        super();
       }
   
       protected ZipFileSet(FileSet fileset) {
  -      super(fileset);
  +        super(fileset);
  +    }
  +
  +    protected ZipFileSet(ZipFileSet fileset) {
  +        super(fileset);
  +        srcFile = fileset.srcFile;
  +        prefix = fileset.prefix;
  +        fullpath = fileset.fullpath;
  +        hasDir = fileset.hasDir;
  +        fileMode = fileset.fileMode;
  +        dirMode = fileset.dirMode;
       }
   
       /**
  @@ -180,6 +193,44 @@
           } else {
               return super.getDirectoryScanner(p);
           }
  +    }
  +
  +    /**
  +     * A 3 digit octal string, specify the user, group and 
  +     * other modes in the standard Unix fashion; 
  +     * optional, default=0644
  +     *
  +     * @since Ant 1.6
  +     */
  +    public void setFileMode(String octalString) {
  +        this.fileMode = 
  +            UnixStat.FILE_FLAG | Integer.parseInt(octalString, 8);
  +    }
  +    
  +    /**
  +     * @since Ant 1.6
  +     */
  +    public int getFileMode() {
  +        return fileMode;
  +    }
  +    
  +    /**
  +     * A 3 digit octal string, specify the user, group and 
  +     * other modes in the standard Unix fashion; 
  +     * optional, default=0755
  +     *
  +     * @since Ant 1.6
  +     */
  +    public void setDirMode(String octalString) {
  +        this.dirMode = 
  +            UnixStat.DIR_FLAG | Integer.parseInt(octalString, 8);
  +    }
  +    
  +    /**
  +     * @since Ant 1.6
  +     */
  +    public int getDirMode() {
  +        return dirMode;
       }
   
       /**
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message