Utility.assertNotNull("CorsRules", cors.getCorsRules()); for (CorsRule rule : cors.getCorsRules()) { if (rule.getAllowedOrigins().isEmpty() || rule.getAllowedMethods().isEmpty() || rule.getMaxAgeInSeconds() < 0) {
corsRule.setExposedHeaders(exposedHeaders); corsRule.setMaxAgeInSeconds(maxAgeInSeconds); cors.getCorsRules().add(corsRule); blobServiceProperties.setCors(cors);
this.props.getCors().getCorsRules().add(this.rule);
this.props.getCors().getCorsRules().add(this.rule);
/** * Takes a List of CorsRules and tries to upload them. Then tries to download them and compares the list to the * initial CorsRule List. */ private void testCorsRules(List<CorsRule> corsRules, ServiceClient client, ServiceProperties properties, FileServiceProperties fileServiceProperties) throws StorageException, InterruptedException { CorsProperties cors = (fileServiceProperties == null) ? properties.getCors() : fileServiceProperties.getCors(); cors.getCorsRules().clear(); for (CorsRule rule : corsRules) { cors.getCorsRules().add(rule); } if (fileServiceProperties == null) { callUploadServiceProps(client, properties, null); assertServicePropertiesAreEqual(properties, callDownloadServiceProperties(client)); } else { CloudFileClient fileClient = ((CloudFileClient) client); fileClient.uploadServiceProperties(fileServiceProperties); Thread.sleep(30000); assertFileServicePropertiesAreEqual(fileServiceProperties, fileClient.downloadServiceProperties()); } }
/** * Takes a CorsRule and tries to upload it. Then tries to download it and compares it to the initial CorsRule. */ private void testCorsRules(CorsRule rule, ServiceClient client, ServiceProperties properties, FileServiceProperties fileServiceProperties) throws StorageException, InterruptedException { CorsProperties cors = (fileServiceProperties == null) ? properties.getCors() : fileServiceProperties.getCors(); cors.getCorsRules().clear(); cors.getCorsRules().add(rule); if (fileServiceProperties == null) { callUploadServiceProps(client, properties, null); assertServicePropertiesAreEqual(properties, callDownloadServiceProperties(client)); } else { CloudFileClient fileClient = ((CloudFileClient) client); fileClient.uploadServiceProperties(fileServiceProperties); Thread.sleep(30000); assertFileServicePropertiesAreEqual(fileServiceProperties, fileClient.downloadServiceProperties()); } }
Utility.assertNotNull("CorsRules", cors.getCorsRules()); for (CorsRule rule : cors.getCorsRules()) { if (rule.getAllowedOrigins().isEmpty() || rule.getAllowedMethods().isEmpty() || rule.getMaxAgeInSeconds() < 0) {
assertEquals(original.getCors().getCorsRules().size(), target.getCors().getCorsRules().size()); for (int i = 0; i < original.getCors().getCorsRules().size(); i++) { CorsRule ruleOriginal = original.getCors().getCorsRules().get(i); CorsRule ruleTarget = target.getCors().getCorsRules().get(i);
props.getMinuteMetrics().setVersion("1.0"); props.getCors().getCorsRules().clear(); Arrays.asList("x-ms-meta-data*", "x-ms-meta-source*", "x-ms-meta-abc", "x-ms-meta-bcd")); ruleBasic.setMaxAgeInSeconds(500); newProps.getCors().getCorsRules().add(ruleBasic);
private void testAnalyticsDisable(ServiceClient client, ServiceProperties props) throws StorageException, InterruptedException { props.getLogging().setLogOperationTypes(EnumSet.noneOf(LoggingOperations.class)); props.getLogging().setRetentionIntervalInDays(null); props.getLogging().setVersion("1.0"); props.getHourMetrics().setMetricsLevel(MetricsLevel.DISABLED); props.getHourMetrics().setRetentionIntervalInDays(null); props.getHourMetrics().setVersion("1.0"); props.getMinuteMetrics().setMetricsLevel(MetricsLevel.DISABLED); props.getMinuteMetrics().setRetentionIntervalInDays(null); props.getMinuteMetrics().setVersion("1.0"); props.getCors().getCorsRules().clear(); callUploadServiceProps(client, props, null); assertServicePropertiesAreEqual(props, callDownloadServiceProperties(client)); }
assertEquals(propsA.getCors().getCorsRules().size(), propsB.getCors().getCorsRules().size()); for (int i = 0; i < propsA.getCors().getCorsRules().size(); i++) { CorsRule ruleA = propsA.getCors().getCorsRules().get(i); CorsRule ruleB = propsB.getCors().getCorsRules().get(i);