/** * Adds a queryString to an URI. * * @param resourceURI * the URI of the resource * @param fieldCollection * the key/ values collection to append. * @return an appended URI. * @throws URISyntaxException * if the resulting URI is invalid. * @throws StorageException */ public static URI addToSingleUriQuery(final URI resourceURI, final HashMap<String, String[]> fieldCollection) throws URISyntaxException, StorageException { if (resourceURI == null) { return null; } final UriQueryBuilder outUri = new UriQueryBuilder(); // Generate new queryString for (final Entry<String, String[]> entry : fieldCollection.entrySet()) { for (final String val : entry.getValue()) { outUri.add(entry.getKey(), val); } } return outUri.addToURI(resourceURI); }
/** * Adds a queryString to an URI. * * @param resourceURI * the URI of the resource * @param fieldCollection * the key/ values collection to append. * @return an appended URI. * @throws URISyntaxException * if the resulting URI is invalid. * @throws StorageException */ public static URI addToSingleUriQuery(final URI resourceURI, final HashMap<String, String[]> fieldCollection) throws URISyntaxException, StorageException { if (resourceURI == null) { return null; } final UriQueryBuilder outUri = new UriQueryBuilder(); // Generate new queryString for (final Entry<String, String[]> entry : fieldCollection.entrySet()) { for (final String val : entry.getValue()) { outUri.add(entry.getKey(), val); } } return outUri.addToURI(resourceURI); }
final URL resourceUrl = builder.addToURI(uri).toURL();
final URL resourceUrl = builder.addToURI(uri).toURL();
final URL resourceUrl = builder.addToURI(uri).toURL();
/** * Requests the service to start an incremental copy of another page blob's contents, properties, and metadata * to this blob. * * @param sourceSnapshot * A <code>CloudPageBlob</code> object that represents the source blob to copy. Must be a snapshot. * * @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 startIncrementalCopy(final CloudPageBlob sourceSnapshot) throws StorageException, URISyntaxException { final UriQueryBuilder builder = new UriQueryBuilder(); builder.add(Constants.QueryConstants.SNAPSHOT, sourceSnapshot.snapshotID); URI sourceUri = builder.addToURI(sourceSnapshot.getTransformedAddress(null).getPrimaryUri()); return this.startIncrementalCopy(sourceUri, null /* destinationAccessCondition */, null /* options */, null /* opContext */); }
/** * Requests the service to start an incremental copy of another page blob's contents, properties, and metadata * to this blob. * * @param sourceSnapshot * A <code>CloudPageBlob</code> object that represents the source blob to copy. Must be a snapshot. * * @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 startIncrementalCopy(final CloudPageBlob sourceSnapshot) throws StorageException, URISyntaxException { final UriQueryBuilder builder = new UriQueryBuilder(); builder.add(Constants.QueryConstants.SNAPSHOT, sourceSnapshot.snapshotID); URI sourceUri = builder.addToURI(sourceSnapshot.getTransformedAddress(null).getPrimaryUri()); return this.startIncrementalCopy(sourceUri, null /* destinationAccessCondition */, null /* options */, null /* opContext */); }
builder.add(Constants.QueryConstants.SNAPSHOT, sourceSnapshot.snapshotID); URI sourceUri = builder.addToURI(sourceSnapshot.getTransformedAddress(null).getPrimaryUri()); return this.startIncrementalCopy(sourceUri, destinationAccessCondition, options, opContext);
builder.add(Constants.QueryConstants.SNAPSHOT, sourceSnapshot.snapshotID); URI sourceUri = builder.addToURI(sourceSnapshot.getTransformedAddress(null).getPrimaryUri()); return this.startIncrementalCopy(sourceUri, destinationAccessCondition, options, opContext);
CloudFileShare snapshotRef5 = new CloudFileShare(uriBuilder.addToURI(this.share.getUri()), this.share.getServiceClient().getCredentials()); assertEquals(snapshot.snapshotID, snapshotRef5.snapshotID);
uriBuilder.add("sharesnapshot", snapshot.snapshotID); uriBuilder.add("restype", "directory"); CloudFileDirectory snapshotDir2 = new CloudFileDirectory(uriBuilder.addToURI(dir.getUri()), this.share.getServiceClient().getCredentials()); assertEquals(snapshot.snapshotID, snapshotDir2.getShare().snapshotID); assertTrue(snapshotDir2.exists());
CloudFile snapshotFile2 = new CloudFile(uriBuilder.addToURI(file.getUri()), this.share.getServiceClient().getCredentials()); assertEquals(snapshot.snapshotID, snapshotFile2.getShare().snapshotID); assertTrue(snapshotFile2.exists());
URI sourceUri = TestHelper.defiddler(builder.addToURI(sasSnapshotBlob.getTransformedAddress(null).getPrimaryUri()));