*/
public ResourceNameIterator findResourceNames(final String resourceName) {
if (log.isDebugEnabled())
log.debug("find: resourceName='" + resourceName + "'");
return new ResourceNameIterator() {
private int idx = 0;
private ResourceNameIterator iterator = null;
public boolean hasNext() {
if (iterator == null || !iterator.hasNext()) {
iterator = getNextIterator();
if (iterator == null) {
return false;
}
}
return iterator.hasNext();
}
public String nextResourceName() {
return iterator.nextResourceName();
}
private ResourceNameIterator getNextIterator() {
while (idx < size()) {
ResourceNameIterator iter =
getResourceNameDiscover(idx++).findResourceNames(resourceName);
if (iter.hasNext()) {
return iter;
}
}
return null;
}