本文整理汇总了Java中com.microsoft.azure.storage.AccessCondition.applyLeaseConditionToRequest方法的典型用法代码示例。如果您正苦于以下问题:Java AccessCondition.applyLeaseConditionToRequest方法的具体用法?Java AccessCondition.applyLeaseConditionToRequest怎么用?Java AccessCondition.applyLeaseConditionToRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.microsoft.azure.storage.AccessCondition
的用法示例。
在下文中一共展示了AccessCondition.applyLeaseConditionToRequest方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: abortCopy
import com.microsoft.azure.storage.AccessCondition; //导入方法依赖的package包/类
/**
* Generates a web request to abort a copy operation.
*
* @param uri
* A <code>java.net.URI</code> object that specifies the absolute URI.
* @param blobOptions
* A {@link BlobRequestOptions} 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 CloudBlobClient}.
* @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.
* @param accessCondition
* The access condition to apply to the request. Only lease conditions are supported for this operation.
* @param copyId
* A <code>String</code> object that identifying the copy operation.
* @return a HttpURLConnection configured for the operation.
* @throws StorageException
* an exception representing any error which occurred during the operation.
* @throws IllegalArgumentException
* @throws IOException
* @throws URISyntaxException
*/
public static HttpURLConnection abortCopy(final URI uri, final BlobRequestOptions blobOptions,
final OperationContext opContext, final AccessCondition accessCondition, final String copyId)
throws StorageException, IOException, URISyntaxException {
final UriQueryBuilder builder = new UriQueryBuilder();
builder.add(Constants.QueryConstants.COMPONENT, Constants.QueryConstants.COPY);
builder.add(Constants.QueryConstants.COPY_ID, copyId);
final HttpURLConnection request = BaseRequest.createURLConnection(uri, blobOptions, builder, opContext);
request.setFixedLengthStreamingMode(0);
request.setDoOutput(true);
request.setRequestMethod(Constants.HTTP_PUT);
request.setRequestProperty(Constants.HeaderConstants.COPY_ACTION_HEADER,
Constants.HeaderConstants.COPY_ACTION_ABORT);
if (accessCondition != null) {
accessCondition.applyLeaseConditionToRequest(request);
}
return request;
}
示例2: getAcl
import com.microsoft.azure.storage.AccessCondition; //导入方法依赖的package包/类
/**
* Constructs a web request to return the ACL for this container. Sign with no length specified.
*
* @param uri
* The absolute URI to the container.
* @param timeout
* The server timeout interval.
* @param accessCondition
* An {@link AccessCondition} object that represents the access conditions for the container.
* @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 BlobRequestOptions blobOptions,
final AccessCondition accessCondition, final OperationContext opContext) throws IOException,
URISyntaxException, StorageException {
final UriQueryBuilder builder = getContainerUriQueryBuilder();
builder.add(Constants.QueryConstants.COMPONENT, Constants.QueryConstants.ACL);
final HttpURLConnection request = createURLConnection(uri, builder, blobOptions, opContext);
request.setRequestMethod(Constants.HTTP_GET);
if (accessCondition != null) {
accessCondition.applyLeaseConditionToRequest(request);
}
return request;
}
示例3: setAcl
import com.microsoft.azure.storage.AccessCondition; //导入方法依赖的package包/类
/**
* Sets the ACL for the container. Sign with length of aclBytes.
*
* @param uri
* A <code>java.net.URI</code> object that specifies the absolute URI.
* @param blobOptions
* A {@link BlobRequestOptions} 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 CloudBlobClient}.
* @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.
* @param accessCondition
* An {@link AccessCondition} object that represents the access conditions for the container.
* @param publicAccess
* The type of public access to allow for the container.
* @return a HttpURLConnection configured for the operation.
* @throws StorageException
* */
public static HttpURLConnection setAcl(final URI uri, final BlobRequestOptions blobOptions,
final OperationContext opContext, final AccessCondition accessCondition,
final BlobContainerPublicAccessType publicAccess) throws IOException, URISyntaxException, StorageException {
if (publicAccess == BlobContainerPublicAccessType.UNKNOWN) {
throw new IllegalArgumentException(String.format(Utility.LOCALE_US, SR.ARGUMENT_OUT_OF_RANGE_ERROR, "accessType", publicAccess));
}
final UriQueryBuilder builder = getContainerUriQueryBuilder();
builder.add(Constants.QueryConstants.COMPONENT, Constants.QueryConstants.ACL);
final HttpURLConnection request = createURLConnection(uri, builder, blobOptions, opContext);
request.setRequestMethod(Constants.HTTP_PUT);
request.setDoOutput(true);
if (publicAccess != BlobContainerPublicAccessType.OFF) {
request.setRequestProperty(BlobConstants.BLOB_PUBLIC_ACCESS_HEADER, publicAccess.toString().toLowerCase());
}
if (accessCondition != null) {
accessCondition.applyLeaseConditionToRequest(request);
}
return request;
}
示例4: getAcl
import com.microsoft.azure.storage.AccessCondition; //导入方法依赖的package包/类
/**
* Constructs a web request to return the ACL for this share. Sign with no length specified.
*
* @param uri
* The absolute URI to the share.
* @param fileOptions
* 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 accessCondition
* An {@link AccessCondition} object that represents the access conditions for the share.
* @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 FileRequestOptions fileOptions,
final AccessCondition accessCondition, final OperationContext opContext) throws IOException,
URISyntaxException, StorageException {
final UriQueryBuilder builder = getShareUriQueryBuilder();
builder.add(Constants.QueryConstants.COMPONENT, Constants.QueryConstants.ACL);
final HttpURLConnection request = BaseRequest.createURLConnection(uri, fileOptions, builder, opContext);
request.setRequestMethod(Constants.HTTP_GET);
if (accessCondition != null && !Utility.isNullOrEmpty(accessCondition.getLeaseID())) {
accessCondition.applyLeaseConditionToRequest(request);
}
return request;
}
示例5: setAcl
import com.microsoft.azure.storage.AccessCondition; //导入方法依赖的package包/类
/**
* Sets the ACL for the share. Sign with length of aclBytes.
*
* @param uri
* A <code>java.net.URI</code> object that specifies the absolute URI.
* @param fileOptions
* 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.
* @param accessCondition
* An {@link AccessCondition} object that represents the access conditions for the share.
* @return a HttpURLConnection configured for the operation.
* @throws StorageException
* */
public static HttpURLConnection setAcl(final URI uri, final FileRequestOptions fileOptions,
final OperationContext opContext, final AccessCondition accessCondition)
throws IOException, URISyntaxException, StorageException {
final UriQueryBuilder builder = getShareUriQueryBuilder();
builder.add(Constants.QueryConstants.COMPONENT, Constants.QueryConstants.ACL);
final HttpURLConnection request = BaseRequest.createURLConnection(uri, fileOptions, builder, opContext);
request.setRequestMethod(Constants.HTTP_PUT);
request.setDoOutput(true);
if (accessCondition != null && !Utility.isNullOrEmpty(accessCondition.getLeaseID())) {
accessCondition.applyLeaseConditionToRequest(request);
}
return request;
}
示例6: getProperties
import com.microsoft.azure.storage.AccessCondition; //导入方法依赖的package包/类
/**
* Constructs a web request to return the user-defined metadata for this container. Sign with no length specified.
*
* @param uri
* A <code>java.net.URI</code> object that specifies the absolute URI.
* @param blobOptions
* A {@link BlobRequestOptions} 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 CloudBlobClient}.
* @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.
* @param accessCondition
* An {@link AccessCondition} object that represents the access conditions for the container.
* @return a HttpURLConnection configured for the operation.
* @throws StorageException
* */
private static HttpURLConnection getProperties(final URI uri, final BlobRequestOptions blobOptions,
final OperationContext opContext, AccessCondition accessCondition, final UriQueryBuilder builder)
throws IOException, URISyntaxException, StorageException {
HttpURLConnection request = BaseRequest.getProperties(uri, blobOptions, builder, opContext);
if (accessCondition != null) {
accessCondition.applyLeaseConditionToRequest(request);
}
return request;
}
示例7: getProperties
import com.microsoft.azure.storage.AccessCondition; //导入方法依赖的package包/类
/**
* Constructs a web request to return the user-defined metadata. Sign with no length specified.
*
* @param uri
* A <code>java.net.URI</code> object that specifies the absolute URI.
* @param fileOptions
* 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.
* @param accessCondition
* An {@link AccessCondition} object that represents the access conditions for the share.
* @param snapshotVersion
* the snapshot version to the query builder.
* @return a HttpURLConnection configured for the operation.
* @throws StorageException
* */
private static HttpURLConnection getProperties(final URI uri, final FileRequestOptions fileOptions,
final OperationContext opContext, AccessCondition accessCondition, final UriQueryBuilder builder,
String snapshotVersion)
throws IOException, URISyntaxException, StorageException {
addShareSnapshot(builder, snapshotVersion);
HttpURLConnection request = BaseRequest.getProperties(uri, fileOptions, builder, opContext);
if (accessCondition != null) {
accessCondition.applyLeaseConditionToRequest(request);
}
return request;
}