@Test public void testMoveWithServerSideEncryptionBucketPolicy() throws Exception { final Path container = new Path("test.cyberduck.ch", EnumSet.of(Path.Type.directory, Path.Type.volume)); final Path test = new Path(container, new AsciiRandomStringService().random(), EnumSet.of(Path.Type.file)); final GoogleStorageTouchFeature touch = new GoogleStorageTouchFeature(session); final TransferStatus status = new TransferStatus(); status.setEncryption(new Encryption.Algorithm("AES256", null)); touch.touch(test, status); assertTrue(new GoogleStorageFindFeature(session).find(test)); final Path renamed = new Path(container, new AsciiRandomStringService().random(), EnumSet.of(Path.Type.file)); new GoogleStorageMoveFeature(session).move(test, renamed, new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback()); assertFalse(new GoogleStorageFindFeature(session).find(test)); assertTrue(new GoogleStorageFindFeature(session).find(renamed)); new GoogleStorageDeleteFeature(session).delete(Collections.singletonList(renamed), new DisabledLoginCallback(), new Delete.DisabledCallback()); }
@Override public Path move(final Path source, final Path target, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException { final Path copy = new GoogleStorageCopyFeature(session).copy(source, target, status, connectionCallback); delete.delete(Collections.singletonMap(source, status), connectionCallback, callback); return copy; }
GoogleStorageMoveFeature implements Move { @Override public Path move(final Path source, final Path target, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException { final Path copy = new GoogleStorageCopyFeature(session).copy(source, target, status, connectionCallback); delete.delete(Collections.singletonMap(source, status), connectionCallback, callback); return copy; } }
GoogleStorageMoveFeature implements Move { @Override public Path move(final Path source, final Path target, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException { final Path copy = new GoogleStorageCopyFeature(session).copy(source, target, status, connectionCallback); delete.delete(Collections.singletonMap(source, status), connectionCallback, callback); return copy; } GoogleStorageMoveFeature(final GoogleStorageSession session); }
GoogleStorageMoveFeature implements Move { @Override public Path move(final Path source, final Path target, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException { final Path copy = new GoogleStorageCopyFeature(session).copy(source, target, status, connectionCallback); delete.delete(Collections.singletonMap(source, status), connectionCallback, callback); return copy; } GoogleStorageMoveFeature(final GoogleStorageSession session); @Override Path move(final Path source, final Path target, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback); @Override boolean isSupported(final Path source, final Path target); }
GoogleStorageMoveFeature implements Move { @Override public Path move(final Path source, final Path target, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException { final Path copy = new GoogleStorageCopyFeature(session).copy(source, target, status, connectionCallback); delete.delete(Collections.singletonMap(source, status), connectionCallback, callback); return copy; } GoogleStorageMoveFeature(final GoogleStorageSession session); @Override Path move(final Path source, final Path target, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback); @Override boolean isSupported(final Path source, final Path target);  }