try {
String[] childrenNames = null;
if (file.isDirectory()) {
File[] children = file.listFiles();
if (children == null)
throw new WebdavException("IO error while listing files for " + file);
List<String> childList = new ArrayList<String>();
for (int i = 0; i < children.length; i++) {
String name = children[i].getName();
childList.add(name);
log.trace("Child " + i + ": " + name);
}
childrenNames = new String[childList.size()];
childrenNames = childList.toArray(childrenNames);
}
return childrenNames;
} catch (Exception e) {
log.error("GridStore.getChildrenNames(" + uri + ") failed", e);
throw new WebdavException(e);
}
}