@Test public void testTouch() throws Exception { final Path bucket = new Path("test.cyberduck.ch", EnumSet.of(Path.Type.directory, Path.Type.volume)); final Path test = new GoogleStorageTouchFeature(session).touch( new Path(bucket, String.format("%s %s", new AlphanumericRandomStringService().random(), new AlphanumericRandomStringService().random()), EnumSet.of(Path.Type.file)), new TransferStatus().withMime("text/plain")); assertTrue(new GoogleStorageFindFeature(session).find(test)); new GoogleStorageDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback()); assertFalse(new GoogleStorageFindFeature(session).find(test)); }
@Override public Path touch(final Path file, final TransferStatus status) throws BackgroundException { status.setLength(0L); final StatusOutputStream<VersionId> out = writer.write(file, status, new DisabledConnectionCallback()); new DefaultStreamCloser().close(out); return new Path(file.getParent(), file.getName(), file.getType(), new PathAttributes(file.attributes()).withVersionId(out.getStatus().id)); }
GoogleStorageTouchFeature implements Touch<VersionId> { @Override public Path touch(final Path file, final TransferStatus status) throws BackgroundException { status.setLength(0L); final StatusOutputStream<VersionId> out = writer.write(file, status, new DisabledConnectionCallback()); new DefaultStreamCloser().close(out); return new Path(file.getParent(), file.getName(), file.getType(), new PathAttributes(file.attributes()).withVersionId(out.getStatus().id)); } }
GoogleStorageTouchFeature implements Touch<VersionId> { @Override public Path touch(final Path file, final TransferStatus status) throws BackgroundException { status.setLength(0L); final StatusOutputStream<VersionId> out = writer.write(file, status, new DisabledConnectionCallback()); new DefaultStreamCloser().close(out); return new Path(file.getParent(), file.getName(), file.getType(), new PathAttributes(file.attributes()).withVersionId(out.getStatus().id)); } GoogleStorageTouchFeature(final GoogleStorageSession session); }
GoogleStorageTouchFeature implements Touch<VersionId> { @Override public Path touch(final Path file, final TransferStatus status) throws BackgroundException { status.setLength(0L); final StatusOutputStream<VersionId> out = writer.write(file, status, new DisabledConnectionCallback()); new DefaultStreamCloser().close(out); return new Path(file.getParent(), file.getName(), file.getType(), new PathAttributes(file.attributes()).withVersionId(out.getStatus().id)); } GoogleStorageTouchFeature(final GoogleStorageSession session); @Override Path touch(final Path file, final TransferStatus status); @Override boolean isSupported(final Path workdir, final String filename); @Override Touch<VersionId> withWriter(final Write<VersionId> writer); }
GoogleStorageTouchFeature implements Touch<VersionId> { @Override public Path touch(final Path file, final TransferStatus status) throws BackgroundException { status.setLength(0L); final StatusOutputStream<VersionId> out = writer.write(file, status, new DisabledConnectionCallback()); new DefaultStreamCloser().close(out); return new Path(file.getParent(), file.getName(), file.getType(), new PathAttributes(file.attributes()).withVersionId(out.getStatus().id)); } GoogleStorageTouchFeature(final GoogleStorageSession session); @Override Path touch(final Path file, final TransferStatus status); @Override boolean isSupported(final Path workdir, final String filename); @Override Touch<VersionId> withWriter(final Write<VersionId> writer);  }