/** * Gets the properties. Sign with no length specified. * * @param uri * The Uri to query. * @param builder * The builder. * @param opContext * an object used to track the execution of the operation * @return a web request for performing the operation. * @throws StorageException * @throws URISyntaxException * @throws IOException * */ public static HttpURLConnection getProperties(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { if (builder == null) { builder = new UriQueryBuilder(); } final HttpURLConnection retConnection = createURLConnection(uri, options, builder, opContext); retConnection.setRequestMethod(Constants.HTTP_HEAD); return retConnection; }
/** * Gets the properties. Sign with no length specified. * * @param uri * The Uri to query. * @param timeout * The timeout. * @param builder * The builder. * @param opContext * an object used to track the execution of the operation * @return a web request for performing the operation. * @throws StorageException * @throws URISyntaxException * @throws IOException * */ public static HttpURLConnection getProperties(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { if (builder == null) { builder = new UriQueryBuilder(); } final HttpURLConnection retConnection = createURLConnection(uri, options, builder, opContext); retConnection.setRequestMethod(Constants.HTTP_HEAD); return retConnection; }
public static HttpURLConnection getAccountInfo(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { if (builder == null) { builder = new UriQueryBuilder(); } builder.add(Constants.QueryConstants.RESOURCETYPE, ACCOUNT); builder.add(Constants.QueryConstants.COMPONENT, PROPERTIES); final HttpURLConnection retConnection = createURLConnection(uri, options, builder, opContext); retConnection.setRequestMethod("HEAD"); return retConnection; }
/** * Sets the ACL for the table. Sign with length of aclBytes. * * @param rootUri * A <code>java.net.URI</code> containing an absolute URI to the resource. * @param tableOptions * A {@link TableRequestOptions} object that specifies execution options such as retry policy and timeout * settings for the operation. Specify <code>null</code> to use the request options specified on the * {@link CloudTableClient}. * @param opContext * An {@link OperationContext} object for tracking the current operation. Specify <code>null</code> to * safely ignore operation context. * * @return a HttpURLConnection configured for the operation. * @throws StorageException * */ public static HttpURLConnection setAcl(final URI rootUri, final TableRequestOptions options, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { UriQueryBuilder queryBuilder = new UriQueryBuilder(); queryBuilder.add(Constants.QueryConstants.COMPONENT, "acl"); final HttpURLConnection retConnection = BaseRequest.createURLConnection(rootUri, options, queryBuilder, opContext); retConnection.setRequestMethod("PUT"); retConnection.setDoOutput(true); return retConnection; }
/** * Sets the ACL for the queue. Sign with length of aclBytes. * * @param uri * The absolute URI to the queue. * @param queueOptions * A {@link QueueRequestOptions} object that specifies execution options such as retry policy and timeout * settings for the operation. Specify <code>null</code> to use the request options specified on the * {@link CloudQueueClient}. * @param opContext * An {@link OperationContext} object that represents the context for the current operation. This object * is used to track requests to the storage service, and to provide additional runtime information about * the operation. * @return a HttpURLConnection configured for the operation. * @throws StorageException * */ public static HttpURLConnection setAcl(final URI uri, final QueueRequestOptions queueOptions, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { final UriQueryBuilder builder = new UriQueryBuilder(); builder.add(Constants.QueryConstants.COMPONENT, Constants.QueryConstants.ACL); final HttpURLConnection request = BaseRequest.createURLConnection(uri, queueOptions, builder, opContext); request.setDoOutput(true); request.setRequestMethod(Constants.HTTP_PUT); return request; }
/** * Sets the ACL for the queue. Sign with length of aclBytes. * * @param uri * The absolute URI to the queue. * @param queueOptions * A {@link QueueRequestOptions} object that specifies execution options such as retry policy and timeout * settings for the operation. Specify <code>null</code> to use the request options specified on the * {@link CloudQueueClient}. * @param opContext * An {@link OperationContext} object that represents the context for the current operation. This object * is used to track requests to the storage service, and to provide additional runtime information about * the operation. * @return a HttpURLConnection configured for the operation. * @throws StorageException * */ public static HttpURLConnection setAcl(final URI uri, final QueueRequestOptions queueOptions, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { final UriQueryBuilder builder = new UriQueryBuilder(); builder.add(Constants.QueryConstants.COMPONENT, Constants.QueryConstants.ACL); final HttpURLConnection request = BaseRequest.createURLConnection(uri, queueOptions, builder, opContext); request.setDoOutput(true); request.setRequestMethod(Constants.HTTP_PUT); return request; }
/** * Gets the container Uri query builder. * * A <CODE>UriQueryBuilder</CODE> for the container. * * @throws StorageException */ private static UriQueryBuilder getContainerUriQueryBuilder() throws StorageException { final UriQueryBuilder uriBuilder = new UriQueryBuilder(); try { uriBuilder.add(Constants.QueryConstants.RESOURCETYPE, "container"); } catch (final IllegalArgumentException e) { throw Utility.generateNewUnexpectedStorageException(e); } return uriBuilder; }
/** * Gets the share Uri query builder. * * A <CODE>UriQueryBuilder</CODE> for the share. * * @throws StorageException */ private static UriQueryBuilder getShareUriQueryBuilder() throws StorageException { final UriQueryBuilder uriBuilder = new UriQueryBuilder(); try { uriBuilder.add(Constants.QueryConstants.RESOURCETYPE, "share"); } catch (final IllegalArgumentException e) { throw Utility.generateNewUnexpectedStorageException(e); } return uriBuilder; }
/** * Gets the share Uri query builder. * * A <CODE>UriQueryBuilder</CODE> for the share. * * @throws StorageException */ private static UriQueryBuilder getDirectoryUriQueryBuilder() throws StorageException { final UriQueryBuilder uriBuilder = new UriQueryBuilder(); try { uriBuilder.add(Constants.QueryConstants.RESOURCETYPE, "directory"); } catch (final IllegalArgumentException e) { throw Utility.generateNewUnexpectedStorageException(e); } return uriBuilder; }
/** * Gets the share Uri query builder. * * A <CODE>UriQueryBuilder</CODE> for the share. * * @throws StorageException */ private static UriQueryBuilder getShareUriQueryBuilder() throws StorageException { final UriQueryBuilder uriBuilder = new UriQueryBuilder(); try { uriBuilder.add(Constants.QueryConstants.RESOURCETYPE, "share"); } catch (final IllegalArgumentException e) { throw Utility.generateNewUnexpectedStorageException(e); } return uriBuilder; }
/** * Constructs a web request to return the ACL for this queue. Sign with no length specified. * * @param uri * The absolute URI to the container. * @param queueOptions * A {@link QueueRequestOptions} object that specifies execution options such as retry policy and timeout * settings for the operation. Specify <code>null</code> to use the request options specified on the * {@link CloudQueueClient}. * @param opContext * An {@link OperationContext} object that represents the context for the current operation. This object * is used to track requests to the storage service, and to provide additional runtime information about * the operation. * @return a HttpURLConnection configured for the operation. * @throws StorageException */ public static HttpURLConnection getAcl(final URI uri, final QueueRequestOptions queueOptions, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { final UriQueryBuilder builder = new UriQueryBuilder(); builder.add(Constants.QueryConstants.COMPONENT, Constants.QueryConstants.ACL); final HttpURLConnection request = BaseRequest.createURLConnection(uri, queueOptions, builder, opContext); request.setRequestMethod(Constants.HTTP_GET); return request; }
/** * Constructs a web request to return the ACL for this queue. Sign with no length specified. * * @param uri * The absolute URI to the container. * @param queueOptions * A {@link QueueRequestOptions} object that specifies execution options such as retry policy and timeout * settings for the operation. Specify <code>null</code> to use the request options specified on the * {@link CloudQueueClient}. * @param opContext * An {@link OperationContext} object that represents the context for the current operation. This object * is used to track requests to the storage service, and to provide additional runtime information about * the operation. * @return a HttpURLConnection configured for the operation. * @throws StorageException */ public static HttpURLConnection getAcl(final URI uri, final QueueRequestOptions queueOptions, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { final UriQueryBuilder builder = new UriQueryBuilder(); builder.add(Constants.QueryConstants.COMPONENT, Constants.QueryConstants.ACL); final HttpURLConnection request = BaseRequest.createURLConnection(uri, queueOptions, builder, opContext); request.setRequestMethod(Constants.HTTP_GET); return request; }
/** * Gets the share Uri query builder. * * A <CODE>UriQueryBuilder</CODE> for the share. * * @throws StorageException */ private static UriQueryBuilder getDirectoryUriQueryBuilder() throws StorageException { final UriQueryBuilder uriBuilder = new UriQueryBuilder(); try { uriBuilder.add(Constants.QueryConstants.RESOURCETYPE, "directory"); } catch (final IllegalArgumentException e) { throw Utility.generateNewUnexpectedStorageException(e); } return uriBuilder; }
/** * Gets the container Uri query builder. * * A <CODE>UriQueryBuilder</CODE> for the container. * * @throws StorageException */ private static UriQueryBuilder getContainerUriQueryBuilder() throws StorageException { final UriQueryBuilder uriBuilder = new UriQueryBuilder(); try { uriBuilder.add(Constants.QueryConstants.RESOURCETYPE, "container"); } catch (final IllegalArgumentException e) { throw Utility.generateNewUnexpectedStorageException(e); } return uriBuilder; }
/** * Constructs a web request to return the ACL for this table. Sign with no length specified. * * @param rootUri * A <code>java.net.URI</code> containing an absolute URI to the resource. * @param tableOptions * A {@link TableRequestOptions} object that specifies execution options such as retry policy and timeout * settings for the operation. Specify <code>null</code> to use the request options specified on the * {@link CloudTableClient}. * @param opContext * An {@link OperationContext} object for tracking the current operation. Specify <code>null</code> to * safely ignore operation context. * * @return a HttpURLConnection configured for the operation. * @throws StorageException */ public static HttpURLConnection getAcl(final URI rootUri, final TableRequestOptions options, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { UriQueryBuilder queryBuilder = new UriQueryBuilder(); queryBuilder.add(Constants.QueryConstants.COMPONENT, "acl"); final HttpURLConnection retConnection = BaseRequest.createURLConnection(rootUri, options, queryBuilder, opContext); retConnection.setRequestMethod("GET"); return retConnection; }
/** * Constructs a web request to return the ACL for this table. Sign with no length specified. * * @param rootUri * A <code>java.net.URI</code> containing an absolute URI to the resource. * @param tableOptions * A {@link TableRequestOptions} object that specifies execution options such as retry policy and timeout * settings for the operation. Specify <code>null</code> to use the request options specified on the * {@link CloudTableClient}. * @param opContext * An {@link OperationContext} object for tracking the current operation. Specify <code>null</code> to * safely ignore operation context. * * @return a HttpURLConnection configured for the operation. * @throws StorageException */ public static HttpURLConnection getAcl(final URI rootUri, final TableRequestOptions options, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { UriQueryBuilder queryBuilder = new UriQueryBuilder(); queryBuilder.add(Constants.QueryConstants.COMPONENT, "acl"); final HttpURLConnection retConnection = BaseRequest.createURLConnection(rootUri, options, queryBuilder, opContext); retConnection.setRequestMethod("GET"); return retConnection; }
/** * Creates a HttpURLConnection used to retrieve the Analytics service properties from the storage service. * * @param uri * The service endpoint. * @param builder * The builder. * @param opContext * an object used to track the execution of the operation * @return a web request for performing the operation. * @throws IOException * @throws URISyntaxException * @throws StorageException */ public static HttpURLConnection getServiceProperties(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { if (builder == null) { builder = new UriQueryBuilder(); } builder.add(Constants.QueryConstants.COMPONENT, PROPERTIES); builder.add(Constants.QueryConstants.RESOURCETYPE, SERVICE); final HttpURLConnection retConnection = createURLConnection(uri, options, builder, opContext); retConnection.setRequestMethod(Constants.HTTP_GET); return retConnection; }
/** * 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 */); }
/** * Gets a {@link UriQueryBuilder} for listing. * * @param listingContext * A {@link ListingContext} object that specifies parameters for * the listing operation, if any. May be <code>null</code>. * * @throws StorageException * If a storage service error occurred during the operation. */ public static UriQueryBuilder getListUriQueryBuilder(final ListingContext listingContext) throws StorageException { final UriQueryBuilder builder = new UriQueryBuilder(); builder.add(Constants.QueryConstants.COMPONENT, Constants.QueryConstants.LIST); if (listingContext != null) { if (!Utility.isNullOrEmpty(listingContext.getPrefix())) { builder.add(Constants.QueryConstants.PREFIX, listingContext.getPrefix()); } if (!Utility.isNullOrEmpty(listingContext.getMarker())) { builder.add(Constants.QueryConstants.MARKER, listingContext.getMarker()); } if (listingContext.getMaxResults() != null && listingContext.getMaxResults() > 0) { builder.add(Constants.QueryConstants.MAX_RESULTS, listingContext.getMaxResults().toString()); } } return builder; }