/** * Get the dir mode of the archive fileset * @param p the project to use * @return the mode */ public int getDirMode(Project p) { if (isReference()) { return ((ArchiveFileSet) getRef(p)).getDirMode(p); } dieOnCircularReference(); return dirMode; }
/** * Fulfill the ResourceCollection contract. * @return Iterator of Resources. * @since Ant 1.7 */ @Override public Iterator<Resource> iterator() { if (isReference()) { return ((ResourceCollection) (getRef(getProject()))).iterator(); } if (src == null) { return super.iterator(); } ArchiveScanner as = (ArchiveScanner) getDirectoryScanner(getProject()); return as.getResourceFiles(getProject()); }
/** * Get the mode of the archive fileset * @param p the project to use * @return the mode */ public int getFileMode(Project p) { if (isReference()) { return ((ArchiveFileSet) getRef(p)).getFileMode(p); } dieOnCircularReference(); return fileMode; }
/** * Get the archive from which entries will be extracted. * @param p the project to use * @return the source file */ public File getSrc(Project p) { if (isReference()) { return ((ArchiveFileSet) getRef(p)).getSrc(p); } return getSrc(); }
/** * Return the full pathname of the single entry in this fileset. * @param p the project to use * @return the full path */ public String getFullpath(Project p) { if (isReference()) { return ((ArchiveFileSet) getRef(p)).getFullpath(p); } dieOnCircularReference(p); return fullpath; }
if (fileset instanceof ArchiveFileSet) { zfs = (ArchiveFileSet) fileset; prefix = zfs.getPrefix(getProject()); fullpath = zfs.getFullpath(getProject()); dirMode = zfs.getDirMode(getProject()); fileMode = zfs.getFileMode(getProject()); File base = null; if (zfs == null || zfs.getSrc(getProject()) == null) { dealingWithFiles = true; base = fileset.getDir(getProject()); } else if (zfs instanceof ZipFileSet) { zf = new ZipFile(zfs.getSrc(getProject()), encoding); final int thisDirMode = zfs != null && zfs.hasDirModeBeenSet() ? dirMode : getUnixMode(resource, zf, dirMode); addDirectoryResource(resource, name, prefix, } else { final int thisFileMode = zfs != null && zfs.hasFileModeBeenSet() ? fileMode : getUnixMode(resource, zf, fileMode); zOut, thisFileMode, zf, zfs == null ? null : zfs.getSrc(getProject()));
File archive = fileset.getSrc( getProject()); String prefix = normalizePath( fileset.getPrefix( getProject())); if ( !prefix.endsWith( "/")) prefix += "/"; DirectoryScanner scanner = fileset.getDirectoryScanner( getProject()); int filemode = fileset.getFileMode( getProject()) & 07777; int dirmode = fileset.getDirMode( getProject()) & 07777; String username = null; String group = null;
/** * Whether the user has specified the mode explicitly. * * @return true if it has been set */ public boolean hasDirModeBeenSet() { if (isReference()) { return ((ArchiveFileSet) getRef(getProject())).hasDirModeBeenSet(); } dieOnCircularReference(); return dirModeHasBeenSet; }
/** * Whether the user has specified the mode explicitly. * @return true if it has been set */ public boolean hasFileModeBeenSet() { if (isReference()) { return ((ArchiveFileSet) getRef(getProject())).hasFileModeBeenSet(); } dieOnCircularReference(); return fileModeHasBeenSet; }
/** * Return the prefix prepended to entries in the archive file. * @param p the project to use * @return the prefix */ public String getPrefix(Project p) { if (isReference()) { return ((ArchiveFileSet) getRef(p)).getPrefix(p); } dieOnCircularReference(p); return prefix; }
/** * Return a ArchiveFileSet that has the same properties * as this one. * @return the cloned archiveFileSet * @since Ant 1.6 */ @Override public Object clone() { if (isReference()) { return getCheckedRef(ArchiveFileSet.class, getDataTypeName(), getProject()).clone(); } return super.clone(); }
/** * Get the archive file from which entries will be extracted. * @return the archive in case the archive is a file, null otherwise. */ public File getSrc() { if (isReference()) { return ((ArchiveFileSet) getCheckedRef()).getSrc(); } dieOnCircularReference(); if (src == null) { return null; } return src.asOptional(FileProvider.class).map(FileProvider::getFile).orElse(null); }
if (rcs[i] instanceof ArchiveFileSet) { ArchiveFileSet afs = (ArchiveFileSet) rcs[i]; if (!afs.getFullpath(getProject()).isEmpty()) { name = afs.getFullpath(getProject()); } else if (!afs.getPrefix(getProject()).isEmpty()) { String prefix = afs.getPrefix(getProject()); if (!prefix.endsWith("/") && !prefix.endsWith("\\")) { prefix += "/";
afs = (ArchiveFileSet) rc; if (afs != null && afs.size() > 1 && !afs.getFullpath(this.getProject()).isEmpty()) { throw new BuildException( "fullpath attribute may only be specified for filesets that specify a single file.");
/** * Return a TarFileSet that has the same properties * as this one. * @return the cloned tarFileSet */ @Override public Object clone() { if (isReference()) { return getRef(getProject()).clone(); } return super.clone(); }
/** * Configure a fileset based on this fileset. * If the fileset is a TarFileSet copy in the tarfileset * specific attributes. * @param zfs the archive fileset to configure. */ @Override protected void configureFileSet(ArchiveFileSet zfs) { super.configureFileSet(zfs); if (zfs instanceof TarFileSet) { TarFileSet tfs = (TarFileSet) zfs; tfs.setUserName(userName); tfs.setGroup(groupName); tfs.setUid(uid); tfs.setGid(gid); } }
new IdentityMapper(), existingEntries .getDirectoryScanner(getProject())); if (outOfDate.length > 0 && Mode.UPDATE.equals(getMode().getValue())) { HashSet<String> oodNames = new HashSet<>();
tfs.setProject(getProject()); if (archiveFileSet != null) { tfs.setPrefix(archiveFileSet.getPrefix(getProject())); tfs.setFullpath(archiveFileSet.getFullpath(getProject())); if (archiveFileSet.hasFileModeBeenSet()) { tfs.integerSetFileMode(archiveFileSet .getFileMode(getProject())); if (archiveFileSet.hasDirModeBeenSet()) { tfs.integerSetDirMode(archiveFileSet .getDirMode(getProject()));
File archive = fileset.getSrc( getProject()); String prefix = normalizePath( fileset.getPrefix( getProject())); if ( !prefix.endsWith( "/")) prefix += "/"; DirectoryScanner scanner = fileset.getDirectoryScanner( getProject()); int filemode = fileset.getFileMode( getProject()) & 07777; int dirmode = fileset.getDirMode( getProject()) & 07777; String username = null; String group = null;
/** * Return a ZipFileSet that has the same properties * as this one. * @return the cloned zipFileSet */ @Override public Object clone() { if (isReference()) { return getRef(getProject()).clone(); } return super.clone(); }