/** * Retrieves the current {@link FileServiceProperties} for the given storage service. This encapsulates * the CORS configurations. * * @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. * * @return A {@link FileServiceProperties} object representing the current configuration of the service. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public final FileServiceProperties downloadServiceProperties(FileRequestOptions options, OperationContext opContext) throws StorageException { if (opContext == null) { opContext = new OperationContext(); } opContext.initialize(); options = FileRequestOptions.populateAndApplyDefaults(options, this); return new FileServiceProperties(ExecutionEngine.executeWithRetry( this, null, this.downloadServicePropertiesImpl(options, false), options.getRetryPolicyFactory(), opContext)); }
/** * Retrieves the current {@link FileServiceProperties} for the given storage service. This encapsulates * the CORS configurations. * * @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. * * @return A {@link FileServiceProperties} object representing the current configuration of the service. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public final FileServiceProperties downloadServiceProperties(FileRequestOptions options, OperationContext opContext) throws StorageException { if (opContext == null) { opContext = new OperationContext(); } opContext.initialize(); options = FileRequestOptions.populateAndApplyDefaults(options, this); return new FileServiceProperties(ExecutionEngine.executeWithRetry( this, null, this.downloadServicePropertiesImpl(options, false), options.getRetryPolicyFactory(), opContext)); }
/** * Test CORS with invalid values. */ @Test public void testCorsExpectedExceptions() throws StorageException { ServiceClient client = TestHelper.createCloudBlobClient(); ServiceProperties props = new ServiceProperties(); props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION); testCorsExpectedExceptions(client, props, null); client = TestHelper.createCloudQueueClient(); props = new ServiceProperties(); testCorsExpectedExceptions(client, props, null); client = TestHelper.createCloudTableClient(); props = new ServiceProperties(); testCorsExpectedExceptions(client, props, null); client = TestHelper.createCloudFileClient(); testCorsExpectedExceptions(client, null, new FileServiceProperties()); }
/** * Test Analytics Minute Metrics Level * * @throws StorageException * @throws InterruptedException */ @Test public void testAnalyticsMinuteMetricsLevel() throws StorageException, InterruptedException { ServiceClient client = TestHelper.createCloudBlobClient(); ServiceProperties props = new ServiceProperties(); props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION); testAnalyticsMinuteMetricsLevel(client, props, null); client = TestHelper.createCloudQueueClient(); props = new ServiceProperties(); testAnalyticsMinuteMetricsLevel(client, props, null); client = TestHelper.createCloudTableClient(); props = new ServiceProperties(); testAnalyticsMinuteMetricsLevel(client, props, null); client = TestHelper.createCloudFileClient(); FileServiceProperties fileProps = new FileServiceProperties(); testAnalyticsMinuteMetricsLevel(client, null, fileProps); }
/** * Test CORS with different rules. * * @throws StorageException * @throws InterruptedException */ @Test public void testCloudValidCorsRules() throws StorageException, InterruptedException { ServiceClient client = TestHelper.createCloudBlobClient(); ServiceProperties props = new ServiceProperties(); props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION); testCloudValidCorsRules(client, props, null); client = TestHelper.createCloudQueueClient(); props = new ServiceProperties(); testCloudValidCorsRules(client, props, null); client = TestHelper.createCloudTableClient(); props = new ServiceProperties(); testCloudValidCorsRules(client, props, null); client = TestHelper.createCloudFileClient(); testCloudValidCorsRules(client, null, new FileServiceProperties()); }
/** * Test CORS with a valid and invalid number of origin values sent to server. * * @throws StorageException * @throws InterruptedException */ @Test public void testCorsMaxOrigins() throws StorageException, InterruptedException { ServiceClient client = TestHelper.createCloudBlobClient(); ServiceProperties props = new ServiceProperties(); props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION); testCorsMaxOrigins(client, props, null); client = TestHelper.createCloudQueueClient(); props = new ServiceProperties(); testCorsMaxOrigins(client, props, null); client = TestHelper.createCloudTableClient(); props = new ServiceProperties(); testCorsMaxOrigins(client, props, null); client = TestHelper.createCloudFileClient(); testCorsMaxOrigins(client, null, new FileServiceProperties()); }
/** * Test CORS with a valid and invalid number of header values sent to server. * * @throws StorageException * @throws InterruptedException */ @Test public void testCorsMaxHeaders() throws StorageException, InterruptedException { ServiceClient client = TestHelper.createCloudBlobClient(); ServiceProperties props = new ServiceProperties(); props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION); testCorsMaxHeaders(client, props, null); client = TestHelper.createCloudQueueClient(); props = new ServiceProperties(); testCorsMaxHeaders(client, props, null); client = TestHelper.createCloudTableClient(); props = new ServiceProperties(); testCorsMaxHeaders(client, props, null); client = TestHelper.createCloudFileClient(); testCorsMaxHeaders(client, null, new FileServiceProperties()); }
/** * Test Analytics Hour Metrics Level * * @throws StorageException * @throws InterruptedException */ @Test public void testAnalyticsHourMetricsLevel() throws StorageException, InterruptedException { ServiceClient client = TestHelper.createCloudBlobClient(); ServiceProperties props = new ServiceProperties(); props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION); testAnalyticsHourMetricsLevel(client, props, null); client = TestHelper.createCloudQueueClient(); props = new ServiceProperties(); testAnalyticsHourMetricsLevel(client, props, null); client = TestHelper.createCloudTableClient(); props = new ServiceProperties(); testAnalyticsHourMetricsLevel(client, props, null); client = TestHelper.createCloudFileClient(); FileServiceProperties fileProps = new FileServiceProperties(); testAnalyticsHourMetricsLevel(client, null, fileProps); }