use of org.eclipse.ceylon.cmr.repository.webdav.WebDAVResource in project ceylon by eclipse.
the class WebDAVContentStore method find.
@Override
public Iterable<? extends OpenNode> find(Node parent) {
if (!connectionAllowed()) {
return Collections.emptyList();
}
final String url = getUrlAsString(parent);
try {
final List<OpenNode> nodes = new ArrayList<>();
final List<WebDAVResource> resources = repository.list(url);
for (WebDAVResource dr : resources) {
final String label = dr.getName();
final RemoteNode node = new RemoteNode(label);
if (dr.isDirectory())
node.setContentMarker();
else
node.setHandle(new WebDAVContentHandle(url + label));
nodes.add(node);
}
return nodes;
} catch (IOException e) {
log.debug("Failed to list url: " + url);
return Collections.emptyList();
}
}
Aggregations