/** * For file-based archivefilesets, return the same as for normal filesets; * else just return the path of the zip. * @return for file based archivefilesets, included files as a list * of semicolon-separated filenames. else just the name of the zip. */ @Override public String toString() { if (hasDir && getProject() != null) { return super.toString(); } return src == null ? null : src.getName(); }
/** * 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()); }
/** * A check attributes for archiveFileSet. * If there is a reference, and * it is a ArchiveFileSet, the archive fileset attributes * cannot be used. * (Note, we can only see if the reference is an archive * fileset if the project has been set). */ private void checkArchiveAttributesAllowed() { if (getProject() == null || (isReference() && (getRefid().getReferencedObject( getProject()) instanceof ArchiveFileSet))) { checkAttributesAllowed(); } }
/** * 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; }
/** * 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(); }
/** * 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 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(); }