* @return an array of Element descriptors for files present (found by traversing all levels of dirs)
* in the input element descriptor
* @throws DataStorageException
*/
private static ElementDescriptor[] getFileElementDescriptors(ElementDescriptor elem) throws DataStorageException {
DataStorage store = elem.getDataStorage();
ElementDescriptor[] elems = store.asCollection(elem.toString());
// elems could have directories in it, if so
// get the files out so that it contains only files
List<ElementDescriptor> paths = new ArrayList<ElementDescriptor>();
List<ElementDescriptor> filePaths = new ArrayList<ElementDescriptor>();
for (int m = 0; m < elems.length; m++) {
paths.add(elems[m]);
}
for (int j = 0; j < paths.size(); j++) {
ElementDescriptor fullPath = store.asElement(store
.getActiveContainer(), paths.get(j));
// Skip hadoop's private/meta files ...
if (fullPath.systemElement()) {
continue;
}