@Test public void testFind() throws Exception { final StoregateIdProvider nodeid = new StoregateIdProvider(session).withCache(cache); final Path room = new StoregateDirectoryFeature(session, nodeid).mkdir( new Path(String.format("/My files/%s", new AlphanumericRandomStringService().random()), EnumSet.of(Path.Type.directory, Path.Type.volume)), null, new TransferStatus()); assertTrue(room.attributes().getPermission().isExecutable()); final Path test = new StoregateTouchFeature(session, nodeid).touch( new Path(room, String.format("%s", new AlphanumericRandomStringService().random()), EnumSet.of(Path.Type.file)), new TransferStatus()); final PathAttributes attr = new StoregateAttributesFinderFeature(session, nodeid).find(test); assertNotEquals(0L, attr.getModificationDate()); assertEquals(Checksum.NONE, attr.getChecksum()); assertNull(attr.getETag()); assertNull(attr.getVersionId()); assertFalse(attr.getPermission().isExecutable()); assertTrue(attr.getPermission().isReadable()); assertTrue(attr.getPermission().isWritable()); new StoregateDeleteFeature(session, nodeid).delete(Collections.singletonList(room), new DisabledPasswordCallback(), new Delete.DisabledCallback()); }
@Override public PathAttributes find(final Path file) throws BackgroundException { try { final FilesApi files = new FilesApi(session.getClient()); return this.toAttributes(files.filesGet_1(URIEncoder.encode(fileid.getPrefixedPath(file)))); } catch(ApiException e) { throw new StoregateExceptionMappingService().map("Failure to read attributes of {0}", e, file); } }
StoregateAttributesFinderFeature implements AttributesFinder { @Override public PathAttributes find(final Path file) throws BackgroundException { try { final FilesApi files = new FilesApi(session.getClient()); return this.toAttributes(files.filesGet_1(URIEncoder.encode(fileid.getPrefixedPath(file)))); } catch(ApiException e) { throw new StoregateExceptionMappingService().map("Failure to read attributes of {0}", e, file); } } }
StoregateAttributesFinderFeature implements AttributesFinder { @Override public PathAttributes find(final Path file) throws BackgroundException { try { final FilesApi files = new FilesApi(session.getClient()); return this.toAttributes(files.filesGet_1(URIEncoder.encode(fileid.getPrefixedPath(file)))); } catch(ApiException e) { throw new StoregateExceptionMappingService().map("Failure to read attributes of {0}", e, file); } } StoregateAttributesFinderFeature(final StoregateSession session, final StoregateIdProvider fileid); }
StoregateAttributesFinderFeature implements AttributesFinder { @Override public PathAttributes find(final Path file) throws BackgroundException { try { final FilesApi files = new FilesApi(session.getClient()); return this.toAttributes(files.filesGet_1(URIEncoder.encode(fileid.getPrefixedPath(file)))); } catch(ApiException e) { throw new StoregateExceptionMappingService().map("Failure to read attributes of {0}", e, file); } } StoregateAttributesFinderFeature(final StoregateSession session, final StoregateIdProvider fileid); @Override PathAttributes find(final Path file); PathAttributes toAttributes(final File f); }
StoregateAttributesFinderFeature implements AttributesFinder { @Override public PathAttributes find(final Path file) throws BackgroundException { try { final FilesApi files = new FilesApi(session.getClient()); return this.toAttributes(files.filesGet_1(URIEncoder.encode(fileid.getPrefixedPath(file)))); } catch(ApiException e) { throw new StoregateExceptionMappingService().map("Failure to read attributes of {0}", e, file); } } StoregateAttributesFinderFeature(final StoregateSession session, final StoregateIdProvider fileid); @Override PathAttributes find(final Path file); PathAttributes toAttributes(final File f);  }