/** * Construct a new ConcatResourceInputStream * for the specified ResourceCollection. * @param rc the ResourceCollection to combine. */ public ConcatResourceInputStream(ResourceCollection rc) { iter = rc.iterator(); }
@Override public boolean hasNext() { boolean result = ri != null && ri.hasNext(); while (!result && rci.hasNext()) { ri = rci.next().iterator(); result = ri.hasNext(); } return result; } @Override
/** * Set the source resource. * @param a the resource to load as a single element Resource collection. */ public void addConfigured(ResourceCollection a) { if (a.size() != 1) { throw new BuildException( "only single argument resource collections are supported"); } src = a.iterator().next(); }
private Resource getXest(ResourceCollection rc, ResourceComparator c) { return StreamUtils.iteratorAsStream(rc.iterator()).max(c).orElse(null); }
/** * Set the source resource. * @param a the resource to load as a single element Resource collection. * @since Ant 1.7 */ public synchronized void addConfigured(ResourceCollection a) { if (src != null) { throw new BuildException("only a single source is supported"); } if (a.size() != 1) { throw new BuildException( "only single-element resource collections are supported"); } src = a.iterator().next(); }
/** * Set the source resource. * @param a the resource to pack as a single element Resource collection. */ public void addConfigured(ResourceCollection a) { if (a.size() != 1) { throw new BuildException( "only single argument resource collections are supported as archives"); } setSrcResource(a.iterator().next()); }
/** * Set the source resource. * @param a the source resource collection. * @since Ant 1.7 */ public void addConfigured(ResourceCollection a) { if (a.size() != 1) { throw new BuildException( "only single argument resource collections are supported."); } setSrcResource(a.iterator().next()); }
/** * Set the source Archive resource. * @param a the archive as a single element Resource collection. */ public void addConfigured(ResourceCollection a) { if (a.size() != 1) { throw new BuildException( "only single argument resource collections are supported as archives"); } setSrcResource(a.iterator().next()); }
/** * Sets the archive that holds this as a single element Resource * collection. * @param a the archive as a single element Resource collection. */ public void addConfigured(ResourceCollection a) { checkChildrenAllowed(); if (archive != null) { throw new BuildException( "you must not specify more than one archive"); } if (a.size() != 1) { throw new BuildException( "only single argument resource collections are supported as archives"); } archive = a.iterator().next(); }
/** * Set the source Archive file for the archivefileset. Prevents both * "dir" and "src" from being specified. * @param a the archive as a single element Resource collection. */ public void addConfigured(ResourceCollection a) { checkChildrenAllowed(); if (a.size() != 1) { throw new BuildException("only single argument resource collections" + " are supported as archives"); } setSrcResource(a.iterator().next()); }
/** * Sets the resource to wrap using a single-element collection. * @param a the resource to wrap as a single element Resource collection. */ public final void addConfigured(ResourceCollection a) { checkChildrenAllowed(); if (resource != null) { throw new BuildException( "you must not specify more than one resource"); } if (a.size() != 1) { throw new BuildException( "only single argument resource collections are supported"); } setChecked(false); resource = a.iterator().next(); }
private void resolveRefid() { try { if (getProject() == null) { throw new BuildException("Cannot retrieve refid; project unset"); } Object o = getProject().getReference(refid); if (!(o instanceof Resource)) { if (o instanceof ResourceCollection) { ResourceCollection rc = (ResourceCollection) o; if (rc.size() == 1) { o = rc.iterator().next(); } } else { throw new BuildException("Illegal value at '%s': %s", refid, o); } } this.resource = (Resource) o; } finally { refid = null; } }
/** * Fulfill the ResourceCollection contract. * @return an Iterator of Resources. */ @Override public synchronized Iterator<Resource> iterator() { if (isReference()) { return getRef().iterator(); } validate(); return new FailFast(this, coll.iterator()); }
for (int i = 0; i < rcs.size(); i++) { ResourceCollection rc = (ResourceCollection) rcs.elementAt(i); Iterator<Resource> resources = rc.iterator(); while (resources.hasNext()) { Resource r = (Resource) resources.next();
final Resource res = rc.iterator().next(); final FileProvider r = res.as(FileProvider.class); if (file == null) {
/** * Set the source resource. * @param a the resource to pack as a single element Resource collection. */ public void addConfigured(ResourceCollection a) { if (a.size() == 0) { throw new BuildException( "No resource selected, %s needs exactly one resource.", getTaskName()); } if (a.size() != 1) { throw new BuildException( "%s cannot handle multiple resources at once. (%d resources were selected.)", getTaskName(), a.size()); } setSrcResource(a.iterator().next()); }
/** * Fulfill the ResourceCollection contract. The Iterator returned * will throw ConcurrentModificationExceptions if ResourceCollections * are added to this container while the Iterator is in use. * * @return a "fail-fast" Iterator. */ @Override public final synchronized Iterator<Resource> iterator() { if (isReference()) { return getCheckedRef().iterator(); } return cache().iterator(); }
new MultiReader<>(c.iterator(), resourceReaderFactory)); Reader rdr; if (header == null && footer == null) {
/** * Fulfill the ResourceCollection contract. The Iterator returned * will throw ConcurrentModificationExceptions if ResourceCollections * are added to this container while the Iterator is in use. * @return a "fail-fast" Iterator. */ @Override public final synchronized Iterator<Resource> iterator() { if (isReference()) { return ((Path) getCheckedRef()).iterator(); } dieOnCircularReference(); if (getPreserveBC()) { return new FileResourceIterator(getProject(), null, list()); } return union == null ? Collections.<Resource> emptySet().iterator() : assertFilesystemOnly(union).iterator(); }
/** * 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()); }