/** * Generate a <code>FileServiceProperties</code> from the given <code>ServiceProperties</code>. * * @param properties * The <code>ServiceProperties</code> to use */ FileServiceProperties(ServiceProperties properties) { this.serviceProperties = properties; this.serviceProperties.setLogging(null); this.serviceProperties.setDefaultServiceVersion(null); }
/** * Generate a <code>FileServiceProperties</code> from the given <code>ServiceProperties</code>. * * @param properties * The <code>ServiceProperties</code> to use */ FileServiceProperties(ServiceProperties properties) { this.serviceProperties = properties; this.serviceProperties.setLogging(null); this.serviceProperties.setDefaultServiceVersion(null); }
this.props.setDefaultServiceVersion(value);
this.props.setDefaultServiceVersion(value);
private void testAnalyticsDefaultServiceVersion(ServiceClient client, ServiceProperties props) throws StorageException, InterruptedException { if (client.getClass().equals(CloudBlobClient.class)) { props.setDefaultServiceVersion("2009-09-19"); callUploadServiceProps(client, props, null); assertServicePropertiesAreEqual(props, callDownloadServiceProperties(client)); props.setDefaultServiceVersion("2011-08-18"); callUploadServiceProps(client, props, null); assertServicePropertiesAreEqual(props, callDownloadServiceProperties(client)); props.setDefaultServiceVersion("2012-02-12"); callUploadServiceProps(client, props, null); assertServicePropertiesAreEqual(props, callDownloadServiceProperties(client)); props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION); callUploadServiceProps(client, props, null); assertServicePropertiesAreEqual(props, callDownloadServiceProperties(client)); } else { try { props.setDefaultServiceVersion("2009-09-19"); callUploadServiceProps(client, props, null); fail("Should not be able to set default Service Version for non Blob Client"); } catch (IllegalArgumentException e) { assertEquals(e.getMessage(), SR.DEFAULT_SERVICE_VERSION_ONLY_SET_FOR_BLOB_SERVICE); } catch (Exception e) { fail(); } } }
/** * Test Analytics Disable Service Properties * * @throws StorageException * @throws InterruptedException */ @Test public void testAnalyticsDisable() throws StorageException, InterruptedException { ServiceClient client = TestHelper.createCloudBlobClient(); ServiceProperties props = new ServiceProperties(); props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION); testAnalyticsDisable(client, props); client = TestHelper.createCloudQueueClient(); props = new ServiceProperties(); testAnalyticsDisable(client, props); client = TestHelper.createCloudTableClient(); props = new ServiceProperties(); testAnalyticsDisable(client, props); }
/** * Test Analytics Retention Policies * * @throws StorageException * @throws InterruptedException */ @Test public void testAnalyticsRetentionPolicies() throws StorageException, InterruptedException { ServiceClient client = TestHelper.createCloudBlobClient(); ServiceProperties props = new ServiceProperties(); props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION); testAnalyticsRetentionPolicies(client, props); client = TestHelper.createCloudQueueClient(); props = new ServiceProperties(); testAnalyticsRetentionPolicies(client, props); client = TestHelper.createCloudTableClient(); props = new ServiceProperties(); testAnalyticsRetentionPolicies(client, props); }
/** * Test Analytics Default Service Version * * @throws StorageException * @throws InterruptedException */ @Test public void testAnalyticsDefaultServiceVersion() throws StorageException, InterruptedException { ServiceClient client = TestHelper.createCloudBlobClient(); ServiceProperties props = new ServiceProperties(); props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION); testAnalyticsDefaultServiceVersion(client, props); client = TestHelper.createCloudQueueClient(); props = new ServiceProperties(); testAnalyticsDefaultServiceVersion(client, props); client = TestHelper.createCloudTableClient(); props = new ServiceProperties(); testAnalyticsDefaultServiceVersion(client, props); }
/** * Test Analytics Logging Operations * * @throws StorageException * @throws InterruptedException */ @Test public void testAnalyticsLoggingOperations() throws StorageException, InterruptedException { ServiceClient client = TestHelper.createCloudBlobClient(); ServiceProperties props = new ServiceProperties(); props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION); testAnalyticsLoggingOperations(client, props); client = TestHelper.createCloudQueueClient(); props = new ServiceProperties(); testAnalyticsLoggingOperations(client, props); client = TestHelper.createCloudTableClient(); props = new ServiceProperties(); testAnalyticsLoggingOperations(client, props); }
/** * Test Optional Service Properties * * @throws StorageException * @throws InterruptedException */ @Test public void testOptionalServiceProperties() throws StorageException, InterruptedException { ServiceClient client = TestHelper.createCloudBlobClient(); ServiceProperties props = new ServiceProperties(); props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION); testOptionalServiceProperties(client, props); client = TestHelper.createCloudQueueClient(); props = new ServiceProperties(); testOptionalServiceProperties(client, props); client = TestHelper.createCloudTableClient(); props = new ServiceProperties(); testOptionalServiceProperties(client, props); }
/** * 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 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); }
/** * 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); }