/** * Performs the check for circular references and returns the * referenced object. * This is an override which does not delegate to the superclass; instead it invokes * {@link #getRef(Project)}, because that contains the special support for fileset * references, which can be handled by all ArchiveFileSets. * @param p the Ant Project instance against which to resolve references. * @return the dereferenced object. * @throws BuildException if the reference is invalid (circular ref, wrong class, etc). * @since Ant 1.8 */ // TODO is the above true? AFAICT the calls look circular :/ @Override protected Object getCheckedRef(Project p) { return getRef(p); }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * Get the encoding used for this ZipFileSet. * @return String encoding. * @since Ant 1.9.5 */ public String getEncoding() { if (isReference()) { AbstractFileSet ref = getRef(getProject()); return ref instanceof ArchiveFileSet ? ((ArchiveFileSet) ref).getEncoding() : null; } return encoding; }
/** * 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; }
/** * Fulfill the ResourceCollection contract. * @return size of the collection as int. * @since Ant 1.7 */ @Override public int size() { if (isReference()) { return ((ResourceCollection) (getRef(getProject()))).size(); } if (src == null) { return super.size(); } ArchiveScanner as = (ArchiveScanner) getDirectoryScanner(getProject()); return as.getIncludedFilesCount(); }
public DirectoryScanner getDirectoryScanner(Project p) { if (isReference()) { return getRef(p).getDirectoryScanner(p);
/** * 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()); }