Sardine webDavClient = SardineFactory.begin();
try {
String connectionString = "http://192.168.10.14/content/";
List<DavResource> files = webDavClient.list(connectionString,3);
LOG.debug(">>> Got {} files", files.size());
for(DavResource rsc : files) {
LOG.debug("{} / {} bytes / {}", rsc.getName(), rsc.getContentLength(), rsc.getModified());
}
LOG.debug(">>> ---");
} catch (InterruptedException e) {
LOG.warn("Interrupted while collecting inventory for 192.168.10.14");
} catch (IOException e) {
e.printStackTrace();
} finally {
if(webDavClient != null) {
try {
webDavClient.shutdown();
} catch (IOException ioErr) {
// Catch and release
}
}
}