use of org.apache.jackrabbit.core.data.FileDataRecord in project jackrabbit-oak by apache.
the class OakFileDataStore method getAllRecords.
@Override
public Iterator<DataRecord> getAllRecords() {
final String path = normalizeNoEndSeparator(new File(getPath()).getAbsolutePath());
final OakFileDataStore store = this;
return Files.fileTreeTraverser().postOrderTraversal(new File(path)).filter(new Predicate<File>() {
@Override
public boolean apply(File input) {
return input.isFile() && !input.getParent().equals(path);
}
}).transform(new Function<File, DataRecord>() {
@Override
public DataRecord apply(File input) {
return new FileDataRecord(store, new DataIdentifier(input.getName()), input);
}
}).iterator();
}
use of org.apache.jackrabbit.core.data.FileDataRecord in project jackrabbit-oak by apache.
the class OakFileDataStore method getAllMetadataRecords.
@Override
public List<DataRecord> getAllMetadataRecords(String prefix) {
File root = new File(getPath());
List<DataRecord> rootRecords = new ArrayList<DataRecord>();
for (File file : FileFilterUtils.filterList(FileFilterUtils.prefixFileFilter(prefix), root.listFiles())) {
if (!file.isDirectory()) {
// skip directories which are actual data store files
rootRecords.add(new FileDataRecord(this, new DataIdentifier(file.getName()), file));
}
}
return rootRecords;
}
Aggregations