}
public Iterator<Resource> listChildren(Resource parent) {
try {
Node node = parent.adaptTo(Node.class);
final NodeIterator nodes = node.getNodes();
return new Iterator<Resource>() {
public void remove() {
throw new UnsupportedOperationException();
}
public Resource next() {
Node next = nodes.nextNode();
try {
return new MockedResource(MockedResourceResolver.this,
next.getPath(), "nt:unstructured");
} catch (RepositoryException e) {
throw new RuntimeException("RepositoryException: " + e,
e);
}
}
public boolean hasNext() {
return nodes.hasNext();
}
};
} catch (RepositoryException e) {
throw new RuntimeException("RepositoryException: " + e, e);
}