/** * Sets the limit on the size of files (in GB) stored on the share. * * @param shareQuota * A <code>java.lang.Integer</code> object which represents the limit on * the size of files stored on the share. */ public void setShareQuota(Integer shareQuota) { if (shareQuota != null) { Utility.assertInBounds("Share Quota", shareQuota, 1, FileConstants.MAX_SHARE_QUOTA); } this.shareQuota = shareQuota; } }
/** * Adds the Range Header for Blob Service Operations. * * @param request * The request to add the range header to. * @param offset * Starting byte of the range. * @param count * Number of bytes in the range. */ private static void addRangeImpl(String header, HttpURLConnection request, Long offset, Long count) { if (count != null) { Utility.assertNotNull("offset", offset); Utility.assertInBounds("count", count, 1, Long.MAX_VALUE); } if (offset != null) { long rangeStart = offset; long rangeEnd; if (count != null) { rangeEnd = offset + count - 1; request.setRequestProperty(header, String.format( Utility.LOCALE_US, Constants.HeaderConstants.RANGE_HEADER_FORMAT, rangeStart, rangeEnd)); } else { request.setRequestProperty(header, String.format( Utility.LOCALE_US, Constants.HeaderConstants.BEGIN_RANGE_HEADER_FORMAT, rangeStart)); } } }
Utility.assertInBounds("leaseTimeInSeconds", leaseTimeInSeconds, Constants.LEASE_DURATION_MIN, Constants.LEASE_DURATION_MAX); Utility.assertInBounds("breakPeriodInSeconds", breakPeriodInSeconds, Constants.LEASE_BREAK_PERIOD_MIN, Constants.LEASE_BREAK_PERIOD_MAX); request.setRequestProperty(HeaderConstants.LEASE_BREAK_PERIOD_HEADER, breakPeriodInSeconds.toString());
Utility.assertInBounds("leaseTimeInSeconds", leaseTimeInSeconds, Constants.LEASE_DURATION_MIN, Constants.LEASE_DURATION_MAX); Utility.assertInBounds("breakPeriodInSeconds", breakPeriodInSeconds, Constants.LEASE_BREAK_PERIOD_MIN, Constants.LEASE_BREAK_PERIOD_MAX); request.setRequestProperty(HeaderConstants.LEASE_BREAK_PERIOD_HEADER, breakPeriodInSeconds.toString());
Utility.assertInBounds("count", count, 1, Constants.MAX_RANGE_CONTENT_MD5);
Utility.assertInBounds("count", count, 1, Constants.MAX_BLOCK_SIZE);
final int visibilityTimeoutInSeconds, QueueRequestOptions options, OperationContext opContext) throws StorageException { Utility.assertInBounds("numberOfMessages", numberOfMessages, 1, QueueConstants.MAX_NUMBER_OF_MESSAGES_TO_PEEK); Utility.assertInBounds("visibilityTimeoutInSeconds", visibilityTimeoutInSeconds, 0, QueueConstants.MAX_TIME_TO_LIVE_IN_SECONDS);
Utility.assertInBounds("count", count, 1, Constants.MAX_RANGE_CONTENT_MD5);
Utility.assertInBounds("count", count, 1, Constants.MAX_BLOCK_SIZE);
final int visibilityTimeoutInSeconds, QueueRequestOptions options, OperationContext opContext) throws StorageException { Utility.assertInBounds("numberOfMessages", numberOfMessages, 1, QueueConstants.MAX_NUMBER_OF_MESSAGES_TO_PEEK); Utility.assertInBounds("visibilityTimeoutInSeconds", visibilityTimeoutInSeconds, 0, QueueConstants.MAX_VISIBILITY_TIMEOUT_IN_SECONDS);
Utility.assertNotNull("message", message); Utility.assertNotNull("messageContent", message.getMessageContentAsByte()); Utility.assertInBounds("timeToLiveInSeconds", timeToLiveInSeconds, 0, QueueConstants.MAX_TIME_TO_LIVE_IN_SECONDS); Utility.assertInBounds("initialVisibilityDelayInSeconds", initialVisibilityDelayInSeconds, 0, realTimeToLiveInSeconds - 1);
Utility.assertInBounds("initialVisibilityDelayInSeconds", initialVisibilityDelayInSeconds, 0, visibilityUpperBound);
public Iterable<CloudQueueMessage> peekMessages(final int numberOfMessages, QueueRequestOptions options, OperationContext opContext) throws StorageException { Utility.assertInBounds("numberOfMessages", numberOfMessages, 1, QueueConstants.MAX_NUMBER_OF_MESSAGES_TO_PEEK);
public Iterable<CloudQueueMessage> peekMessages(final int numberOfMessages, QueueRequestOptions options, OperationContext opContext) throws StorageException { Utility.assertInBounds("numberOfMessages", numberOfMessages, 1, QueueConstants.MAX_NUMBER_OF_MESSAGES_TO_PEEK);
/** * Creates the share using the specified options and operation context. * * @param options * A {@link FileRequestOptions} object that specifies any additional options for the request. Specifying * <code>null</code> will use the default request options from the associated service client ( * {@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. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public void create(FileRequestOptions options, OperationContext opContext) throws StorageException { if (opContext == null) { opContext = new OperationContext(); } assertNoSnapshot(); if (this.properties != null && this.properties.getShareQuota() != null) { Utility.assertInBounds("Share Quota", this.properties.getShareQuota(), 1, FileConstants.MAX_SHARE_QUOTA); } opContext.initialize(); options = FileRequestOptions.populateAndApplyDefaults(options, this.fileServiceClient); ExecutionEngine.executeWithRetry(this.fileServiceClient, this, createImpl(options), options.getRetryPolicyFactory(), opContext); }
/** * Creates the share using the specified options and operation context. * * @param options * A {@link FileRequestOptions} object that specifies any additional options for the request. Specifying * <code>null</code> will use the default request options from the associated service client ( * {@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. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public void create(FileRequestOptions options, OperationContext opContext) throws StorageException { if (opContext == null) { opContext = new OperationContext(); } assertNoSnapshot(); if (this.properties != null && this.properties.getShareQuota() != null) { Utility.assertInBounds("Share Quota", this.properties.getShareQuota(), 1, FileConstants.MAX_SHARE_QUOTA); } opContext.initialize(); options = FileRequestOptions.populateAndApplyDefaults(options, this.fileServiceClient); ExecutionEngine.executeWithRetry(this.fileServiceClient, this, createImpl(options), options.getRetryPolicyFactory(), opContext); }
Utility.assertInBounds("Share Quota", this.properties.getShareQuota(), 1, FileConstants.MAX_SHARE_QUOTA);
Utility.assertInBounds("Share Quota", this.properties.getShareQuota(), 1, FileConstants.MAX_SHARE_QUOTA);
Utility.assertNotNullOrEmpty("popReceipt", message.getPopReceipt()); Utility.assertInBounds("visibilityTimeoutInSeconds", visibilityTimeoutInSeconds, 0, QueueConstants.MAX_TIME_TO_LIVE_IN_SECONDS);
Utility.assertNotNullOrEmpty("popReceipt", message.getPopReceipt()); Utility.assertInBounds("visibilityTimeoutInSeconds", visibilityTimeoutInSeconds, 0, QueueConstants.MAX_VISIBILITY_TIMEOUT_IN_SECONDS);