@Test public void testSetTimestampDirectory() 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()); final Path test = new Path(room, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)); new StoregateDirectoryFeature(session, nodeid).mkdir(test, null, null); assertNotNull(new StoregateAttributesFinderFeature(session, nodeid).find(test)); final long modified = Instant.now().minusSeconds(5 * 24 * 60 * 60).getEpochSecond() * 1000; new StoregateTimestampFeature(session, nodeid).setTimestamp(test, modified); assertEquals(modified, new StoregateAttributesFinderFeature(session, nodeid).find(test).getModificationDate()); new StoregateDeleteFeature(session, nodeid).delete(Arrays.asList(test, room), new DisabledLoginCallback(), new Delete.DisabledCallback()); }
@Override public void setTimestamp(final Path file, final TransferStatus status) throws BackgroundException { try { final FilesApi files = new FilesApi(session.getClient()); files.filesUpdateFile(fileid.getFileid(file, new DisabledListProgressListener()), new UpdateFilePropertiesRequest().modified(new DateTime(status.getTimestamp()))); } catch(ApiException e) { throw new StoregateExceptionMappingService().map("Failure to write attributes of {0}", e, file); } }
StoregateTimestampFeature extends DefaultTimestampFeature { @Override public void setTimestamp(final Path file, final TransferStatus status) throws BackgroundException { try { final FilesApi files = new FilesApi(session.getClient()); files.filesUpdateFile(fileid.getFileid(file, new DisabledListProgressListener()), new UpdateFilePropertiesRequest().modified(new DateTime(status.getTimestamp()))); } catch(ApiException e) { throw new StoregateExceptionMappingService().map("Failure to write attributes of {0}", e, file); } } }
StoregateTimestampFeature extends DefaultTimestampFeature { @Override public void setTimestamp(final Path file, final TransferStatus status) throws BackgroundException { try { final FilesApi files = new FilesApi(session.getClient()); files.filesUpdateFile(fileid.getFileid(file, new DisabledListProgressListener()), new UpdateFilePropertiesRequest().modified(new DateTime(status.getTimestamp()))); } catch(ApiException e) { throw new StoregateExceptionMappingService().map("Failure to write attributes of {0}", e, file); } } StoregateTimestampFeature(final StoregateSession session, final StoregateIdProvider fileid); }
StoregateTimestampFeature extends DefaultTimestampFeature { @Override public void setTimestamp(final Path file, final TransferStatus status) throws BackgroundException { try { final FilesApi files = new FilesApi(session.getClient()); files.filesUpdateFile(fileid.getFileid(file, new DisabledListProgressListener()), new UpdateFilePropertiesRequest().modified(new DateTime(status.getTimestamp()))); } catch(ApiException e) { throw new StoregateExceptionMappingService().map("Failure to write attributes of {0}", e, file); } } StoregateTimestampFeature(final StoregateSession session, final StoregateIdProvider fileid); @Override void setTimestamp(final Path file, final TransferStatus status); }
StoregateTimestampFeature extends DefaultTimestampFeature { @Override public void setTimestamp(final Path file, final TransferStatus status) throws BackgroundException { try { final FilesApi files = new FilesApi(session.getClient()); files.filesUpdateFile(fileid.getFileid(file, new DisabledListProgressListener()), new UpdateFilePropertiesRequest().modified(new DateTime(status.getTimestamp()))); } catch(ApiException e) { throw new StoregateExceptionMappingService().map("Failure to write attributes of {0}", e, file); } } StoregateTimestampFeature(final StoregateSession session, final StoregateIdProvider fileid); @Override void setTimestamp(final Path file, final TransferStatus status);  }