@Test public void testMove() throws Exception { final Host host = new Host(new AzureProtocol(), "kahy9boj3eib.blob.core.windows.net", new Credentials( System.getProperties().getProperty("azure.account"), System.getProperties().getProperty("azure.key") )); final AzureSession session = new AzureSession(host); new LoginConnectionService(new DisabledLoginCallback(), new DisabledHostKeyCallback(), new DisabledPasswordStore(), new DisabledProgressListener()).connect(session, PathCache.empty(), new DisabledCancelCallback()); final Path container = new Path("cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume)); final Path test = new Path(container, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file)); new AzureTouchFeature(session, null).touch(test, new TransferStatus()); assertTrue(new AzureFindFeature(session, null).find(test)); final Path target = new Path(container, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file)); new AzureMoveFeature(session, null).move(test, target, new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback()); assertFalse(new AzureFindFeature(session, null).find(test)); assertTrue(new AzureFindFeature(session, null).find(target)); new AzureDeleteFeature(session, null).delete(Collections.<Path>singletonList(target), new DisabledLoginCallback(), new Delete.DisabledCallback()); }
@Override public Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException { final Path copy = new AzureCopyFeature(session, context).copy(file, renamed, new TransferStatus().length(file.attributes().getSize()), connectionCallback); delete.delete(Collections.singletonList(file), connectionCallback, callback); return copy; }
AzureMoveFeature implements Move { @Override public Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException { final Path copy = new AzureCopyFeature(session, context).copy(file, renamed, new TransferStatus().length(file.attributes().getSize()), connectionCallback); delete.delete(Collections.singletonList(file), connectionCallback, callback); return copy; } }
AzureMoveFeature implements Move { @Override public Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException { final Path copy = new AzureCopyFeature(session, context).copy(file, renamed, new TransferStatus().length(file.attributes().getSize()), connectionCallback); delete.delete(Collections.singletonList(file), connectionCallback, callback); return copy; } AzureMoveFeature(final AzureSession session, final OperationContext context); }
AzureMoveFeature implements Move { @Override public Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException { final Path copy = new AzureCopyFeature(session, context).copy(file, renamed, new TransferStatus().length(file.attributes().getSize()), connectionCallback); delete.delete(Collections.singletonList(file), connectionCallback, callback); return copy; } AzureMoveFeature(final AzureSession session, final OperationContext context); @Override boolean isSupported(final Path source, final Path target); @Override Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback); }
AzureMoveFeature implements Move { @Override public Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException { final Path copy = new AzureCopyFeature(session, context).copy(file, renamed, new TransferStatus().length(file.attributes().getSize()), connectionCallback); delete.delete(Collections.singletonList(file), connectionCallback, callback); return copy; } AzureMoveFeature(final AzureSession session, final OperationContext context); @Override boolean isSupported(final Path source, final Path target); @Override Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback);  }