Browse Source

Some prelimnary commit for bug 6492 - I'm still trying to understand how Info-Zip stores the permissions

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273616 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
d66c043757
1 changed files with 53 additions and 2 deletions
  1. +53
    -2
      src/main/org/apache/tools/ant/types/ZipFileSet.java

+ 53
- 2
src/main/org/apache/tools/ant/types/ZipFileSet.java View File

@@ -58,6 +58,7 @@ import java.util.Stack;
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 @@ public class ZipFileSet extends FileSet {
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;
}

/**
@@ -182,6 +195,44 @@ public class ZipFileSet extends FileSet {
}
}

/**
* 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;
}

/**
* A ZipFileset can accept any fileset as a reference as it just uses the
* standard directory scanner.


Loading…
Cancel
Save