/** * Creates the web request. * * @param uri * The absolute URI to the container. * @param query * The query builder to use. * @param blobOptions * the options to use for the request. * @param opContext * a tracking object for the request * @return a HttpURLConnection configured for the operation. * @throws StorageException * an exception representing any error which occurred during the operation. * @throws IllegalArgumentException */ private static HttpURLConnection createURLConnection(final URI uri, final UriQueryBuilder query, final BlobRequestOptions blobOptions, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { return BaseRequest.createURLConnection(uri, blobOptions, query, opContext); }
/** * Creates the web request. * * @param uri * The absolute URI to the container. * @param timeout * The server timeout interval. * @param query * The query builder to use. * @param blobOptions * the options to use for the request. * @param opContext * a tracking object for the request * @return a HttpURLConnection configured for the operation. * @throws StorageException * an exception representing any error which occurred during the operation. * @throws IllegalArgumentException */ private static HttpURLConnection createURLConnection(final URI uri, final UriQueryBuilder query, final BlobRequestOptions blobOptions, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { return BaseRequest.createURLConnection(uri, blobOptions, query, opContext); }
/** * 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; }
/** * Deletes the specified resource. Sign with no length specified. * * @param uri * the request Uri. * @param builder * the UriQueryBuilder for the request * @param opContext * an object used to track the execution of the operation * @return a HttpURLConnection to perform the operation. * @throws IOException * if there is an error opening the connection * @throws URISyntaxException * if there is an improperly formated URI * @throws StorageException */ public static HttpURLConnection delete(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_DELETE); 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; }
/** * Sets the metadata. Sign with 0 length. * * @param uri * The blob Uri. * @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 setMetadata(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, METADATA); final HttpURLConnection retConnection = createURLConnection(uri, options, builder, opContext); retConnection.setFixedLengthStreamingMode(0); retConnection.setDoOutput(true); retConnection.setRequestMethod(Constants.HTTP_PUT); 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; }
/** * Un-deletes the specified resource. Sign with no length specified. * * @param uri * the request Uri. * @param builder * the UriQueryBuilder for the request * @param opContext * an object used to track the execution of the operation * @return a HttpURLConnection to perform the operation. * @throws IOException * if there is an error opening the connection * @throws URISyntaxException * if there is an improperly formated URI * @throws StorageException */ public static HttpURLConnection undelete(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, Constants.QueryConstants.UNDELETE); final HttpURLConnection retConnection = createURLConnection(uri, options, builder, opContext); retConnection.setFixedLengthStreamingMode(0); retConnection.setDoOutput(true); retConnection.setRequestMethod(Constants.HTTP_PUT); 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 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; }
/** * 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 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 stats, such as usage, for this share. Sign with no length specified. * * @param uri * A <code>java.net.URI</code> object that specifies the absolute URI. * @param options * A {@link FileRequestOptions} 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 CloudFileClient}. * @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 getShareStats(final URI uri, final FileRequestOptions options, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { UriQueryBuilder shareBuilder = getShareUriQueryBuilder(); shareBuilder.add(Constants.QueryConstants.COMPONENT, Constants.QueryConstants.STATS); final HttpURLConnection retConnection = BaseRequest.createURLConnection(uri, options, shareBuilder, opContext); retConnection.setRequestMethod(Constants.HTTP_GET); return retConnection; }
/** * 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 stats, such as usage, for this share. Sign with no length specified. * * @param uri * A <code>java.net.URI</code> object that specifies the absolute URI. * @param options * A {@link FileRequestOptions} 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 CloudFileClient}. * @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 getShareStats(final URI uri, final FileRequestOptions options, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { UriQueryBuilder shareBuilder = getShareUriQueryBuilder(); shareBuilder.add(Constants.QueryConstants.COMPONENT, Constants.QueryConstants.STATS); final HttpURLConnection retConnection = BaseRequest.createURLConnection(uri, options, shareBuilder, opContext); retConnection.setRequestMethod(Constants.HTTP_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 set the Analytics service properties on 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 setServiceProperties(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.setDoOutput(true); retConnection.setRequestMethod(Constants.HTTP_PUT); return retConnection; }
/** * Creates a web request to get the stats of the 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 getServiceStats(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, STATS); builder.add(Constants.QueryConstants.RESOURCETYPE, SERVICE); final HttpURLConnection retConnection = createURLConnection(uri, options, builder, 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; }