public Iterator<Resource> findResources(String query, String language) {
List<Resource> resources = new ArrayList<Resource>();
try {
NodeIterator iterator = session.getWorkspace().getQueryManager().createQuery(query, language).execute().getNodes();
while (iterator.hasNext()) {
Node n = iterator.nextNode();
Resource resource = new MockedResource(this, n);
resources.add(resource);
}
} catch (RepositoryException e) {
LOG.error("Unable to execute JCR query", e);