OakFileDataStore extends FileDataStore implements SharedDataStore { @Override public Iterator<DataIdentifier> getAllIdentifiers() { final String path = normalizeNoEndSeparator(new File(getPath()).getAbsolutePath()); 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, DataIdentifier>() { @Override public DataIdentifier apply(File input) { return new DataIdentifier(input.getName()); } }).iterator(); } OakFileDataStore(); @Override Iterator<DataIdentifier> getAllIdentifiers(); void setReferenceKeyEncoded(String encodedKey); void setReferenceKeyPlainText(String textKey); void setReferenceKey(byte[] referenceKey); @Override void addMetadataRecord(InputStream input, String name); @Override void addMetadataRecord(File input, String name); @Override DataRecord getMetadataRecord(String name); @Override boolean metadataRecordExists(String name); @Override List<DataRecord> getAllMetadataRecords(String prefix); @Override boolean deleteMetadataRecord(String name); @Override void deleteAllMetadataRecords(String prefix); @Override Iterator<DataRecord> getAllRecords(); @Override DataRecord getRecordForId(DataIdentifier id); @Override Type getType(); static final Logger LOG; }
@Test public void testGetAllIdentifiers() throws Exception { File f = new File("./target", "oak-fds-test3"); testGetAllIdentifiers(f.getAbsolutePath(), f.getPath()); }