/** * Requests the service to start copying a blob's contents, properties, and metadata to a new file. * * @param sourceBlob * A <code>CloudBlob</code> object that represents the source blob to copy. * * @return A <code>String</code> which represents the copy ID associated with the copy operation. * * @throws StorageException * If a storage service error occurred. * @throws URISyntaxException */ @DoesServiceRequest public final String startCopy(final CloudBlob sourceBlob) throws StorageException, URISyntaxException { return this.startCopy(sourceBlob, null /* sourceAccessCondition */, null /* destinationAccessCondition */, null /* options */, null /* opContext */); }
/** * Requests the service to start copying a URI's contents, properties, and metadata to a new Azure File. * * @param source * The source's <code>java.net.URI</code>. * * @return A <code>String</code> which represents the copy ID associated with the copy operation. * * @throws StorageException * If a storage service error occurred. * @throws URISyntaxException */ @DoesServiceRequest public final String startCopy(final URI source) throws StorageException, URISyntaxException { return this.startCopy(source, null /* sourceAccessCondition */, null /* destinationAccessCondition */, null /* options */, null /* opContext */); }
/** * Requests the service to start copying an Azure File's contents, properties, and metadata to a new Azure File. * * @param sourceFile * A <code>CloudFile</code> object that represents the source Azure File to copy. * * @return A <code>String</code> which represents the copy ID associated with the copy operation. * * @throws StorageException * If a storage service error occurred. * @throws URISyntaxException */ @DoesServiceRequest public final String startCopy(final CloudFile sourceFile) throws StorageException, URISyntaxException { return this.startCopy(sourceFile, null /* sourceAccessCondition */, null /* destinationAccessCondition */, null /* options */, null /* opContext */); }
/** * Requests the service to start copying a blob's contents, properties, and metadata to a new file. * * @param sourceBlob * A <code>CloudBlob</code> object that represents the source blob to copy. * * @return A <code>String</code> which represents the copy ID associated with the copy operation. * * @throws StorageException * If a storage service error occurred. * @throws URISyntaxException */ @DoesServiceRequest public final String startCopy(final CloudBlob sourceBlob) throws StorageException, URISyntaxException { return this.startCopy(sourceBlob, null /* sourceAccessCondition */, null /* destinationAccessCondition */, null /* options */, null /* opContext */); }
/** * Requests the service to start copying an Azure File's contents, properties, and metadata to a new Azure File. * * @param sourceFile * A <code>CloudFile</code> object that represents the source Azure File to copy. * * @return A <code>String</code> which represents the copy ID associated with the copy operation. * * @throws StorageException * If a storage service error occurred. * @throws URISyntaxException */ @DoesServiceRequest public final String startCopy(final CloudFile sourceFile) throws StorageException, URISyntaxException { return this.startCopy(sourceFile, null /* sourceAccessCondition */, null /* destinationAccessCondition */, null /* options */, null /* opContext */); }
/** * Requests the service to start copying a URI's contents, properties, and metadata to a new Azure File. * * @param source * The source's <code>java.net.URI</code>. * * @return A <code>String</code> which represents the copy ID associated with the copy operation. * * @throws StorageException * If a storage service error occurred. * @throws URISyntaxException */ @DoesServiceRequest public final String startCopy(final URI source) throws StorageException, URISyntaxException { return this.startCopy(source, null /* sourceAccessCondition */, null /* destinationAccessCondition */, null /* options */, null /* opContext */); }
throws StorageException, URISyntaxException { Utility.assertNotNull("sourceFile", sourceFile); return this.startCopy(sourceFile.getTransformedAddress(opContext).getPrimaryUri(), sourceAccessCondition, destinationAccessCondition, options, opContext);
throws StorageException, URISyntaxException { Utility.assertNotNull("sourceFile", sourceFile); return this.startCopy(sourceFile.getTransformedAddress(opContext).getPrimaryUri(), sourceAccessCondition, destinationAccessCondition, options, opContext);
return this.startCopy(source, sourceAccessCondition, destinationAccessCondition, options, opContext);
return this.startCopy(source, sourceAccessCondition, destinationAccessCondition, options, opContext);
/** * Start copying a file and then abort * * @throws StorageException * @throws URISyntaxException * @throws IOException * @throws InterruptedException */ @Test @Category({ DevFabricTests.class, DevStoreTests.class }) public void testCopyFileAbort() throws StorageException, URISyntaxException, IOException { final int length = 128; CloudFile originalFile = FileTestHelper.uploadNewFile(this.share, length, null); CloudFile copyFile = this.share.getRootDirectoryReference().getFileReference(originalFile.getName() + "copyed"); copyFile.startCopy(originalFile); try { copyFile.abortCopy(copyFile.getProperties().getCopyState().getCopyId()); fail(); } catch (StorageException e) { if (!e.getErrorCode().contains("NoPendingCopyOperation")) { throw e; } } }
file.startCopy(file); fail("Shouldn't get here");
String copyId = destination.startCopy(blobType.newInstance(credentials.transformUri(source.getUri()))); FileTestHelper.waitForCopy(destination); destination.downloadAttributes();
String copyId = copy.startCopy(FileTestHelper.defiddler(source)); FileTestHelper.waitForCopy(copy);
String copyId = copyDestination.startCopy(copySource); FileTestHelper.waitForCopy(copyDestination); destination.downloadAttributes();
sasBlob.exists(); String copyId = copySas.startCopy(BlobTestHelper.defiddler(sasBlob)); FileTestHelper.waitForCopy(copySas);
/** * @throws StorageException * @throws URISyntaxException * @throws IOException * @throws InterruptedException */ @Test @Category({ DevFabricTests.class, DevStoreTests.class, SlowTests.class }) public void testFileNamePlusEncoding() throws StorageException, URISyntaxException, IOException, InterruptedException { CloudFile originalFile = FileTestHelper.uploadNewFile(this.share, 1024 /* length */, null); CloudFile copyFile = this.share.getRootDirectoryReference().getFileReference(originalFile.getName() + "copyed"); copyFile.startCopy(originalFile); FileTestHelper.waitForCopy(copyFile); copyFile.downloadAttributes(); originalFile.downloadAttributes(); FileProperties prop1 = copyFile.getProperties(); FileProperties prop2 = originalFile.getProperties(); assertEquals(prop1.getCacheControl(), prop2.getCacheControl()); assertEquals(prop1.getContentEncoding(), prop2.getContentEncoding()); assertEquals(prop1.getContentDisposition(), prop2.getContentDisposition()); assertEquals(prop1.getContentLanguage(), prop2.getContentLanguage()); assertEquals(prop1.getContentMD5(), prop2.getContentMD5()); assertEquals(prop1.getContentType(), prop2.getContentType()); }