diff --git a/README.txt b/README.txt index c344a02d53..1bbe809949 100644 --- a/README.txt +++ b/README.txt @@ -42,7 +42,7 @@ our compute api supports: aws-ec2, gogrid, cloudservers (generic), cloudservers- to all of these providers our blobstore api supports: aws-s3, cloudfiles (generic), cloudfiles-us, cloudfiles-uk, - azurestorage, atmos (generic), synaptic-storage, + azureblob, atmos (generic), synaptic-storage, cloudonestorage, s3 (generic), walrus(generic), googlestorage, scaleup-storage, ecc-s3, swift (generic), transient (in-mem), filesystem (on-disk) @@ -50,8 +50,8 @@ our blobstore api supports: aws-s3, cloudfiles (generic), cloudfiles-us, cloudfi * note * the pom dependency org.jclouds/jclouds-allblobstore gives you access to to all of these providers -we also have support for: ibmdev, mezeo, nirvanix, boxdotnet, rimuhosting, openstack nova, - as well a number of features the sandbox +we also have support for: ibmdev, mezeo, nirvanix, boxdotnet, rimuhosting, openstack nova, + azurequeue, simpledb as well a number of features the sandbox If you want access to all jclouds components, include the maven dependency org.jclouds/jclouds-all diff --git a/allblobstore/pom.xml b/allblobstore/pom.xml index cd9507e51e..4a84625999 100644 --- a/allblobstore/pom.xml +++ b/allblobstore/pom.xml @@ -70,8 +70,8 @@ ${project.version} - ${project.groupId} - jclouds-azure + org.jclouds.provider + azureblob ${project.version} diff --git a/azure/src/test/java/org/jclouds/azure/storage/ProvidersInPropertiesTest.java b/azure/src/test/java/org/jclouds/azure/storage/ProvidersInPropertiesTest.java deleted file mode 100644 index 0f10801f21..0000000000 --- a/azure/src/test/java/org/jclouds/azure/storage/ProvidersInPropertiesTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * - * Copyright (C) 2010 Cloud Conscious, LLC. - * - * ==================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ==================================================================== - */ - -package org.jclouds.azure.storage; - -import org.jclouds.blobstore.util.BlobStoreUtils; -import org.jclouds.rest.Providers; -import org.testng.annotations.Test; - -import com.google.common.collect.Iterables; - -/** - * - * @author Adrian Cole - * - */ -@Test(groups = "unit") -public class ProvidersInPropertiesTest { - - @Test - public void testSupportedProviders() { - Iterable providers = Providers.getSupportedProviders(); - assert Iterables.contains(providers, "azurequeue") : providers; - assert Iterables.contains(providers, "azureblob") : providers; - } - - @Test - public void testSupportedBlobStoreProviders() { - Iterable providers = BlobStoreUtils.getSupportedProviders(); - assert !Iterables.contains(providers, "azurequeue") : providers; - assert Iterables.contains(providers, "azureblob") : providers; - } - -} diff --git a/azure/src/test/java/org/jclouds/azure/storage/config/AzureStorageRestClientModuleTest.java b/azure/src/test/java/org/jclouds/azure/storage/config/AzureStorageRestClientModuleTest.java deleted file mode 100644 index d43d46b333..0000000000 --- a/azure/src/test/java/org/jclouds/azure/storage/config/AzureStorageRestClientModuleTest.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * - * Copyright (C) 2010 Cloud Conscious, LLC. - * - * ==================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ==================================================================== - */ - -package org.jclouds.azure.storage.config; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; - -import java.io.IOException; - -import org.jclouds.azure.storage.blob.config.AzureBlobRestClientModule; -import org.jclouds.azure.storage.handlers.AzureStorageClientErrorRetryHandler; -import org.jclouds.azure.storage.handlers.ParseAzureStorageErrorFromXmlContent; -import org.jclouds.date.internal.SimpleDateFormatDateService; -import org.jclouds.http.handlers.DelegatingErrorHandler; -import org.jclouds.http.handlers.DelegatingRetryHandler; -import org.jclouds.http.handlers.RedirectionRetryHandler; -import org.jclouds.logging.log4j.config.Log4JLoggingModule; -import org.jclouds.rest.RestContextFactory; -import org.testng.annotations.Test; - -import com.google.common.base.Supplier; -import com.google.common.collect.ImmutableSet; -import com.google.inject.Injector; -import com.google.inject.Module; - -/** - * @author Adrian Cole - */ -@Test(groups = "unit") -public class AzureStorageRestClientModuleTest { - - Injector createInjector() throws IOException { - return new RestContextFactory().createContextBuilder("azurequeue", "foo", "bar", - ImmutableSet. of(new Log4JLoggingModule())).buildInjector(); - } - - @SuppressWarnings("unchecked") - @Test - void testUpdatesOnlyOncePerSecond() throws NoSuchMethodException, InterruptedException { - @SuppressWarnings("rawtypes") - AzureStorageRestClientModule module = new AzureBlobRestClientModule(); - - Supplier map = module.provideTimeStampCache(1, new SimpleDateFormatDateService()); - String timeStamp = map.get(); - for (int i = 0; i < 10; i++) - map.get(); - assertEquals(timeStamp, map.get()); - Thread.sleep(1001); - assertFalse(timeStamp.equals(map.get())); - } - - @Test - void testServerErrorHandler() throws IOException { - DelegatingErrorHandler handler = createInjector().getInstance(DelegatingErrorHandler.class); - assertEquals(handler.getServerErrorHandler().getClass(), - ParseAzureStorageErrorFromXmlContent.class); - } - - @Test - void testClientErrorHandler() throws IOException { - DelegatingErrorHandler handler = createInjector().getInstance(DelegatingErrorHandler.class); - assertEquals(handler.getClientErrorHandler().getClass(), - ParseAzureStorageErrorFromXmlContent.class); - } - - @Test - void testClientRetryHandler() throws IOException { - DelegatingRetryHandler handler = createInjector().getInstance(DelegatingRetryHandler.class); - assertEquals(handler.getClientErrorRetryHandler().getClass(), - AzureStorageClientErrorRetryHandler.class); - } - - @Test - void testRedirectionRetryHandler() throws IOException { - DelegatingRetryHandler handler = createInjector().getInstance(DelegatingRetryHandler.class); - assertEquals(handler.getRedirectionRetryHandler().getClass(), RedirectionRetryHandler.class); - } - -} \ No newline at end of file diff --git a/azure/README.txt b/common/azure/README.txt similarity index 100% rename from azure/README.txt rename to common/azure/README.txt diff --git a/common/azure/pom.xml b/common/azure/pom.xml new file mode 100644 index 0000000000..5310bf0177 --- /dev/null +++ b/common/azure/pom.xml @@ -0,0 +1,50 @@ + + + + + 4.0.0 + + org.jclouds + jclouds-project + 1.0-SNAPSHOT + ../../project/pom.xml + + org.jclouds.common + azure-common + jclouds Azure Components Core + jclouds Core components to access Azure + + + org.jclouds + jclouds-core + ${project.version} + + + org.jclouds + jclouds-core + ${project.version} + test-jar + test + + + + diff --git a/azure/src/main/java/org/jclouds/azure/storage/AzureStorageContextBuilder.java b/common/azure/src/main/java/org/jclouds/azure/storage/AzureStorageContextBuilder.java similarity index 100% rename from azure/src/main/java/org/jclouds/azure/storage/AzureStorageContextBuilder.java rename to common/azure/src/main/java/org/jclouds/azure/storage/AzureStorageContextBuilder.java diff --git a/azure/src/main/java/org/jclouds/azure/storage/AzureStoragePropertiesBuilder.java b/common/azure/src/main/java/org/jclouds/azure/storage/AzureStoragePropertiesBuilder.java similarity index 78% rename from azure/src/main/java/org/jclouds/azure/storage/AzureStoragePropertiesBuilder.java rename to common/azure/src/main/java/org/jclouds/azure/storage/AzureStoragePropertiesBuilder.java index 328d3b4290..0414c157fc 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/AzureStoragePropertiesBuilder.java +++ b/common/azure/src/main/java/org/jclouds/azure/storage/AzureStoragePropertiesBuilder.java @@ -19,10 +19,8 @@ package org.jclouds.azure.storage; -import static org.jclouds.Constants.PROPERTY_API_VERSION; import static org.jclouds.Constants.PROPERTY_ENDPOINT; import static org.jclouds.Constants.PROPERTY_IDENTITY; -import static org.jclouds.blobstore.reference.BlobStoreConstants.PROPERTY_USER_METADATA_PREFIX; import java.util.Properties; import java.util.regex.Pattern; @@ -31,18 +29,11 @@ import org.jclouds.PropertiesBuilder; import org.jclouds.util.Strings2; /** - * Builds properties used in AzureBlob Connections + * Builds properties used in Azure Connections * * @author Adrian Cole */ public class AzureStoragePropertiesBuilder extends PropertiesBuilder { - @Override - protected Properties defaultProperties() { - Properties properties = super.defaultProperties(); - properties.setProperty(PROPERTY_USER_METADATA_PREFIX, "x-ms-meta-"); - properties.setProperty(PROPERTY_API_VERSION, "2009-09-19"); - return properties; - } public AzureStoragePropertiesBuilder() { this(new Properties()); diff --git a/azure/src/main/java/org/jclouds/azure/storage/AzureStorageResponseException.java b/common/azure/src/main/java/org/jclouds/azure/storage/AzureStorageResponseException.java similarity index 100% rename from azure/src/main/java/org/jclouds/azure/storage/AzureStorageResponseException.java rename to common/azure/src/main/java/org/jclouds/azure/storage/AzureStorageResponseException.java diff --git a/azure/src/main/java/org/jclouds/azure/storage/config/AzureStorageParserModule.java b/common/azure/src/main/java/org/jclouds/azure/storage/config/AzureStorageParserModule.java similarity index 100% rename from azure/src/main/java/org/jclouds/azure/storage/config/AzureStorageParserModule.java rename to common/azure/src/main/java/org/jclouds/azure/storage/config/AzureStorageParserModule.java diff --git a/azure/src/main/java/org/jclouds/azure/storage/config/AzureStorageRestClientModule.java b/common/azure/src/main/java/org/jclouds/azure/storage/config/AzureStorageRestClientModule.java similarity index 100% rename from azure/src/main/java/org/jclouds/azure/storage/config/AzureStorageRestClientModule.java rename to common/azure/src/main/java/org/jclouds/azure/storage/config/AzureStorageRestClientModule.java diff --git a/azure/src/main/java/org/jclouds/azure/storage/domain/AzureStorageError.java b/common/azure/src/main/java/org/jclouds/azure/storage/domain/AzureStorageError.java similarity index 100% rename from azure/src/main/java/org/jclouds/azure/storage/domain/AzureStorageError.java rename to common/azure/src/main/java/org/jclouds/azure/storage/domain/AzureStorageError.java diff --git a/azure/src/main/java/org/jclouds/azure/storage/domain/BoundedSet.java b/common/azure/src/main/java/org/jclouds/azure/storage/domain/BoundedSet.java similarity index 100% rename from azure/src/main/java/org/jclouds/azure/storage/domain/BoundedSet.java rename to common/azure/src/main/java/org/jclouds/azure/storage/domain/BoundedSet.java diff --git a/azure/src/main/java/org/jclouds/azure/storage/domain/internal/BoundedHashSet.java b/common/azure/src/main/java/org/jclouds/azure/storage/domain/internal/BoundedHashSet.java similarity index 100% rename from azure/src/main/java/org/jclouds/azure/storage/domain/internal/BoundedHashSet.java rename to common/azure/src/main/java/org/jclouds/azure/storage/domain/internal/BoundedHashSet.java diff --git a/azure/src/main/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthentication.java b/common/azure/src/main/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthentication.java similarity index 100% rename from azure/src/main/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthentication.java rename to common/azure/src/main/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthentication.java diff --git a/azure/src/main/java/org/jclouds/azure/storage/handlers/AzureStorageClientErrorRetryHandler.java b/common/azure/src/main/java/org/jclouds/azure/storage/handlers/AzureStorageClientErrorRetryHandler.java similarity index 100% rename from azure/src/main/java/org/jclouds/azure/storage/handlers/AzureStorageClientErrorRetryHandler.java rename to common/azure/src/main/java/org/jclouds/azure/storage/handlers/AzureStorageClientErrorRetryHandler.java diff --git a/azure/src/main/java/org/jclouds/azure/storage/handlers/ParseAzureStorageErrorFromXmlContent.java b/common/azure/src/main/java/org/jclouds/azure/storage/handlers/ParseAzureStorageErrorFromXmlContent.java similarity index 77% rename from azure/src/main/java/org/jclouds/azure/storage/handlers/ParseAzureStorageErrorFromXmlContent.java rename to common/azure/src/main/java/org/jclouds/azure/storage/handlers/ParseAzureStorageErrorFromXmlContent.java index 9a665ab9fd..bcdada6fd4 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/handlers/ParseAzureStorageErrorFromXmlContent.java +++ b/common/azure/src/main/java/org/jclouds/azure/storage/handlers/ParseAzureStorageErrorFromXmlContent.java @@ -22,7 +22,6 @@ package org.jclouds.azure.storage.handlers; import static org.jclouds.http.HttpUtils.releasePayload; import java.io.IOException; -import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.annotation.Resource; @@ -31,14 +30,13 @@ import javax.inject.Inject; import org.jclouds.azure.storage.AzureStorageResponseException; import org.jclouds.azure.storage.domain.AzureStorageError; import org.jclouds.azure.storage.util.AzureStorageUtils; -import org.jclouds.blobstore.ContainerNotFoundException; -import org.jclouds.blobstore.KeyNotFoundException; import org.jclouds.http.HttpCommand; import org.jclouds.http.HttpErrorHandler; import org.jclouds.http.HttpResponse; import org.jclouds.http.HttpResponseException; import org.jclouds.logging.Logger; import org.jclouds.rest.AuthorizationException; +import org.jclouds.rest.ResourceNotFoundException; import org.jclouds.util.Strings2; /** @@ -65,14 +63,14 @@ public class ParseAzureStorageErrorFromXmlContent implements HttpErrorHandler { public void handleError(HttpCommand command, HttpResponse response) { Exception exception = new HttpResponseException(command, response); String message = null; + AzureStorageError error = null; try { if (response.getPayload() != null) { String contentType = response.getPayload().getContentMetadata().getContentType(); if (contentType != null && (contentType.indexOf("xml") != -1 || contentType.indexOf("unknown") != -1) - && !new Long(0).equals(response.getPayload().getContentMetadata().getContentLength())) { + && !new Long(0).equals(response.getPayload().getContentMetadata().getContentLength())) { try { - AzureStorageError error = utils.parseAzureStorageErrorFromContent(command, response, response - .getPayload().getInput()); + error = utils.parseAzureStorageErrorFromContent(command, response, response.getPayload().getInput()); if (error != null) { message = error.getMessage(); exception = new AzureStorageResponseException(command, response, error); @@ -93,33 +91,30 @@ public class ParseAzureStorageErrorFromXmlContent implements HttpErrorHandler { } } message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(), - response.getStatusLine()); - switch (response.getStatusCode()) { - case 401: - exception = new AuthorizationException(exception.getMessage(), exception); - break; - case 404: - if (!command.getCurrentRequest().getMethod().equals("DELETE")) { - String path = command.getCurrentRequest().getEndpoint().getPath(); - Matcher matcher = CONTAINER_PATH.matcher(path); - if (matcher.find()) { - exception = new ContainerNotFoundException(matcher.group(1), message); - } else { - matcher = CONTAINER_KEY_PATH.matcher(path); - if (matcher.find()) { - exception = new KeyNotFoundException(matcher.group(1), matcher.group(2), message); - } - } - } - break; - case 411: - exception = new IllegalArgumentException(message); - break; - } + response.getStatusLine()); + exception = refineException(command, response, exception, error, message); } finally { releasePayload(response); command.setException(exception); } } + protected Exception refineException(HttpCommand command, HttpResponse response, Exception exception, + AzureStorageError error, String message) { + switch (response.getStatusCode()) { + case 401: + exception = new AuthorizationException(message, exception); + break; + case 404: + if (!command.getCurrentRequest().getMethod().equals("DELETE")) { + exception = new ResourceNotFoundException(message, exception); + } + break; + case 411: + exception = new IllegalArgumentException(message); + break; + } + return exception; + } + } \ No newline at end of file diff --git a/azure/src/main/java/org/jclouds/azure/storage/options/CreateOptions.java b/common/azure/src/main/java/org/jclouds/azure/storage/options/CreateOptions.java similarity index 100% rename from azure/src/main/java/org/jclouds/azure/storage/options/CreateOptions.java rename to common/azure/src/main/java/org/jclouds/azure/storage/options/CreateOptions.java diff --git a/azure/src/main/java/org/jclouds/azure/storage/options/ListOptions.java b/common/azure/src/main/java/org/jclouds/azure/storage/options/ListOptions.java similarity index 100% rename from azure/src/main/java/org/jclouds/azure/storage/options/ListOptions.java rename to common/azure/src/main/java/org/jclouds/azure/storage/options/ListOptions.java diff --git a/azure/src/main/java/org/jclouds/azure/storage/reference/AzureStorageHeaders.java b/common/azure/src/main/java/org/jclouds/azure/storage/reference/AzureStorageHeaders.java similarity index 100% rename from azure/src/main/java/org/jclouds/azure/storage/reference/AzureStorageHeaders.java rename to common/azure/src/main/java/org/jclouds/azure/storage/reference/AzureStorageHeaders.java diff --git a/azure/src/main/java/org/jclouds/azure/storage/util/AzureStorageUtils.java b/common/azure/src/main/java/org/jclouds/azure/storage/util/AzureStorageUtils.java similarity index 100% rename from azure/src/main/java/org/jclouds/azure/storage/util/AzureStorageUtils.java rename to common/azure/src/main/java/org/jclouds/azure/storage/util/AzureStorageUtils.java diff --git a/azure/src/main/java/org/jclouds/azure/storage/xml/ErrorHandler.java b/common/azure/src/main/java/org/jclouds/azure/storage/xml/ErrorHandler.java similarity index 100% rename from azure/src/main/java/org/jclouds/azure/storage/xml/ErrorHandler.java rename to common/azure/src/main/java/org/jclouds/azure/storage/xml/ErrorHandler.java diff --git a/azure/src/test/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthenticationTest.java b/common/azure/src/test/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthenticationTest.java similarity index 72% rename from azure/src/test/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthenticationTest.java rename to common/azure/src/test/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthenticationTest.java index d06379713e..617900f00d 100755 --- a/azure/src/test/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthenticationTest.java +++ b/common/azure/src/test/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthenticationTest.java @@ -23,19 +23,25 @@ import static org.testng.Assert.assertEquals; import java.io.IOException; import java.net.URI; +import java.util.List; +import java.util.Map; import javax.ws.rs.HttpMethod; import javax.ws.rs.core.HttpHeaders; -import org.jclouds.encryption.internal.Base64; +import org.jclouds.PropertiesBuilder; +import org.jclouds.azure.storage.config.AzureStorageRestClientModule; import org.jclouds.http.HttpRequest; -import org.jclouds.logging.log4j.config.Log4JLoggingModule; +import org.jclouds.logging.config.NullLoggingModule; +import org.jclouds.rest.RestContextBuilder; import org.jclouds.rest.RestContextFactory; +import org.jclouds.rest.RestContextSpec; +import org.jclouds.rest.BaseRestClientTest.MockModule; import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -import com.google.common.collect.ImmutableSet; +import com.google.common.collect.ImmutableList; import com.google.inject.Injector; import com.google.inject.Module; @@ -46,7 +52,6 @@ import com.google.inject.Module; @Test(groups = "unit") public class SharedKeyLiteAuthenticationTest { - private static final String KEY = Base64.encodeBytes("bar".getBytes()); private static final String ACCOUNT = "foo"; private Injector injector; private SharedKeyLiteAuthentication filter; @@ -54,12 +59,12 @@ public class SharedKeyLiteAuthenticationTest { @DataProvider(parallel = true) public Object[][] dataProvider() { return new Object[][] { - { new HttpRequest(HttpMethod.PUT, URI.create("http://" + ACCOUNT - + ".blob.core.windows.net/movies/MOV1.avi?comp=block&blockid=BlockId1&timeout=60")) }, - { new HttpRequest(HttpMethod.PUT, URI.create("http://" + ACCOUNT - + ".blob.core.windows.net/movies/MOV1.avi?comp=blocklist&timeout=120")) }, - { new HttpRequest(HttpMethod.GET, - URI.create("http://" + ACCOUNT + ".blob.core.windows.net/movies/MOV1.avi")) } }; + { new HttpRequest(HttpMethod.PUT, URI.create("http://" + ACCOUNT + + ".blob.core.windows.net/movies/MOV1.avi?comp=block&blockid=BlockId1&timeout=60")) }, + { new HttpRequest(HttpMethod.PUT, URI.create("http://" + ACCOUNT + + ".blob.core.windows.net/movies/MOV1.avi?comp=blocklist&timeout=120")) }, + { new HttpRequest(HttpMethod.GET, URI.create("http://" + ACCOUNT + + ".blob.core.windows.net/movies/MOV1.avi")) } }; } /** @@ -80,7 +85,7 @@ public class SharedKeyLiteAuthenticationTest { request = filter.filter(request); } System.out.printf("%s: %d iterations before the timestamp updated %n", Thread.currentThread().getName(), - iterations); + iterations); } @Test @@ -113,7 +118,7 @@ public class SharedKeyLiteAuthenticationTest { @Test void testAclQueryStringRelativeWithExtraJunk() { URI host = URI.create("http://" + ACCOUNT - + ".blob.core.windows.net/mycontainer?comp=list&marker=marker&maxresults=1&prefix=prefix"); + + ".blob.core.windows.net/mycontainer?comp=list&marker=marker&maxresults=1&prefix=prefix"); HttpRequest request = new HttpRequest(HttpMethod.GET, host); StringBuilder builder = new StringBuilder(); filter.appendUriPath(request, builder); @@ -128,9 +133,14 @@ public class SharedKeyLiteAuthenticationTest { */ @BeforeClass protected void createFilter() throws IOException { - injector = new RestContextFactory().createContextBuilder("azurequeue", ACCOUNT, KEY, - ImmutableSet. of(new Log4JLoggingModule())).buildInjector(); + injector = RestContextFactory.createContextBuilder(DUMMY_SPEC).buildInjector(); filter = injector.getInstance(SharedKeyLiteAuthentication.class); } + @SuppressWarnings("unchecked") + public static final RestContextSpec DUMMY_SPEC = new RestContextSpec("provider", "endpoint", + "apiVersion", "identity", "credential", Map.class, List.class, PropertiesBuilder.class, + (Class) RestContextBuilder.class, ImmutableList. of(new MockModule(), new NullLoggingModule(), + new AzureStorageRestClientModule(Exception.class, RuntimeException.class))); + } \ No newline at end of file diff --git a/azure/src/test/java/org/jclouds/azure/storage/handlers/ParseAzureErrorFromXmlContentTest.java b/common/azure/src/test/java/org/jclouds/azure/storage/handlers/ParseAzureErrorFromXmlContentTest.java similarity index 100% rename from azure/src/test/java/org/jclouds/azure/storage/handlers/ParseAzureErrorFromXmlContentTest.java rename to common/azure/src/test/java/org/jclouds/azure/storage/handlers/ParseAzureErrorFromXmlContentTest.java diff --git a/azure/src/test/java/org/jclouds/azure/storage/options/CreateOptionsTest.java b/common/azure/src/test/java/org/jclouds/azure/storage/options/CreateOptionsTest.java similarity index 100% rename from azure/src/test/java/org/jclouds/azure/storage/options/CreateOptionsTest.java rename to common/azure/src/test/java/org/jclouds/azure/storage/options/CreateOptionsTest.java diff --git a/azure/src/test/java/org/jclouds/azure/storage/options/ListOptionsTest.java b/common/azure/src/test/java/org/jclouds/azure/storage/options/ListOptionsTest.java similarity index 100% rename from azure/src/test/java/org/jclouds/azure/storage/options/ListOptionsTest.java rename to common/azure/src/test/java/org/jclouds/azure/storage/options/ListOptionsTest.java diff --git a/azure/src/test/java/org/jclouds/azure/storage/xml/ErrorHandlerTest.java b/common/azure/src/test/java/org/jclouds/azure/storage/xml/ErrorHandlerTest.java similarity index 100% rename from azure/src/test/java/org/jclouds/azure/storage/xml/ErrorHandlerTest.java rename to common/azure/src/test/java/org/jclouds/azure/storage/xml/ErrorHandlerTest.java diff --git a/azure/src/test/resources/log4j.xml b/common/azure/src/test/resources/log4j.xml similarity index 100% rename from azure/src/test/resources/log4j.xml rename to common/azure/src/test/resources/log4j.xml diff --git a/azure/src/test/resources/test_error.xml b/common/azure/src/test/resources/test_error.xml similarity index 100% rename from azure/src/test/resources/test_error.xml rename to common/azure/src/test/resources/test_error.xml diff --git a/common/pom.xml b/common/pom.xml index 418c349d71..c9f450948a 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -33,6 +33,7 @@ pom jclouds commons project + azure aws openstack vcloud diff --git a/core/src/main/resources/rest.properties b/core/src/main/resources/rest.properties index 552cb8864b..0fe02923d6 100644 --- a/core/src/main/resources/rest.properties +++ b/core/src/main/resources/rest.properties @@ -17,14 +17,14 @@ # ==================================================================== # azurequeue.contextbuilder=org.jclouds.azure.storage.AzureStorageContextBuilder -azurequeue.sync=org.jclouds.azure.storage.queue.AzureQueueClient -azurequeue.async=org.jclouds.azure.storage.queue.AzureQueueAsyncClient +azurequeue.sync=org.jclouds.azurequeue.AzureQueueClient +azurequeue.async=org.jclouds.azurequeue.AzureQueueAsyncClient +azurequeue.apiversion=2009-09-19 azurequeue.propertiesbuilder=org.jclouds.azure.storage.AzureStoragePropertiesBuilder azurequeue.endpoint=https://{identity}.queue.core.windows.net -azureblob.contextbuilder=org.jclouds.azure.storage.blob.AzureBlobContextBuilder -azureblob.propertiesbuilder=org.jclouds.azure.storage.AzureStoragePropertiesBuilder -azureblob.endpoint=https://{identity}.blob.core.windows.net +azureblob.contextbuilder=org.jclouds.azureblob.AzureBlobContextBuilder +azureblob.propertiesbuilder=org.jclouds.azureblob.AzureBlobPropertiesBuilder pcs.contextbuilder=org.jclouds.mezeo.pcs2.PCSContextBuilder pcs.apiVersion=unknown diff --git a/pom.xml b/pom.xml index 161860c55c..c5405a49fd 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,6 @@ drivers tools scriptbuilder - azure allcompute allblobstore all diff --git a/azure/pom.xml b/providers/azureblob/pom.xml similarity index 63% rename from azure/pom.xml rename to providers/azureblob/pom.xml index 80a1e387dd..aaba657908 100644 --- a/azure/pom.xml +++ b/providers/azureblob/pom.xml @@ -20,64 +20,53 @@ --> - + + 4.0.0 org.jclouds jclouds-project 1.0-SNAPSHOT - ../project/pom.xml + ../../project/pom.xml - 4.0.0 - org.jclouds - jclouds-azure - jclouds azure services core - jclouds core components to access azure services + org.jclouds.provider + azureblob + jcloud azureblob provider + jclouds components to access Azure Blob Service - https://auth.api.azurecloud.com - 2009-09-19 - FIXME - FIXME - org.jclouds.azure.storage.blob.blobstore.integration.AzureBlobTestInitializer - https://${test.azure.identity}.blob.core.windows.net - ${test.azure.apiversion} + org.jclouds.azureblob.blobstore.integration.AzureBlobTestInitializer + https://{identity}.blob.core.windows.net + 2009-09-19 ${test.azure.identity} ${test.azure.credential} - https://${test.azure.identity}.queue.core.windows.net - ${test.azure.apiversion} - ${test.azure.identity} - ${test.azure.credential} - - scm:svn:http://jclouds.googlecode.com/svn/trunk/azure - scm:svn:https://jclouds.googlecode.com/svn/trunk/azure - http://jclouds.googlecode.com/svn/trunk/azure - - ${project.groupId} - jclouds-blobstore + org.jclouds.common + azure-common ${project.version} + jar - ${project.groupId} + org.jclouds jclouds-blobstore ${project.version} - test-jar - test + jar - ${project.groupId} + org.jclouds jclouds-core ${project.version} test-jar test - log4j - log4j - 1.2.14 + org.jclouds + jclouds-blobstore + ${project.version} + test-jar test @@ -86,8 +75,15 @@ ${project.version} test + + log4j + log4j + 1.2.16 + test + - + + live @@ -120,22 +116,6 @@ test.azureblob.credential ${test.azureblob.credential} - - test.azurequeue.endpoint - ${test.azurequeue.endpoint} - - - test.azurequeue.apiversion - ${test.azurequeue.apiversion} - - - test.azurequeue.identity - ${test.azurequeue.identity} - - - test.azurequeue.credential - ${test.azurequeue.credential} - test.initializer ${test.initializer} @@ -157,5 +137,7 @@ - + + + diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/AzureBlobAsyncClient.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobAsyncClient.java similarity index 87% rename from azure/src/main/java/org/jclouds/azure/storage/blob/AzureBlobAsyncClient.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobAsyncClient.java index a809d3e099..be91b98c72 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/AzureBlobAsyncClient.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobAsyncClient.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob; +package org.jclouds.azureblob; import java.util.Map; import java.util.concurrent.ExecutionException; @@ -29,20 +29,20 @@ import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; -import org.jclouds.azure.storage.blob.binders.BindAzureBlobMetadataToRequest; -import org.jclouds.azure.storage.blob.domain.BlobProperties; -import org.jclouds.azure.storage.blob.domain.ContainerProperties; -import org.jclouds.azure.storage.blob.domain.ListBlobsResponse; -import org.jclouds.azure.storage.blob.functions.BlobName; -import org.jclouds.azure.storage.blob.functions.ParseBlobFromHeadersAndHttpContent; -import org.jclouds.azure.storage.blob.functions.ParseBlobPropertiesFromHeaders; -import org.jclouds.azure.storage.blob.functions.ParseContainerPropertiesFromHeaders; -import org.jclouds.azure.storage.blob.functions.ReturnFalseIfContainerAlreadyExists; -import org.jclouds.azure.storage.blob.options.CreateContainerOptions; -import org.jclouds.azure.storage.blob.options.ListBlobsOptions; -import org.jclouds.azure.storage.blob.predicates.validators.ContainerNameValidator; -import org.jclouds.azure.storage.blob.xml.AccountNameEnumerationResultsHandler; -import org.jclouds.azure.storage.blob.xml.ContainerNameEnumerationResultsHandler; +import org.jclouds.azureblob.binders.BindAzureBlobMetadataToRequest; +import org.jclouds.azureblob.domain.BlobProperties; +import org.jclouds.azureblob.domain.ContainerProperties; +import org.jclouds.azureblob.domain.ListBlobsResponse; +import org.jclouds.azureblob.functions.BlobName; +import org.jclouds.azureblob.functions.ParseBlobFromHeadersAndHttpContent; +import org.jclouds.azureblob.functions.ParseBlobPropertiesFromHeaders; +import org.jclouds.azureblob.functions.ParseContainerPropertiesFromHeaders; +import org.jclouds.azureblob.functions.ReturnFalseIfContainerAlreadyExists; +import org.jclouds.azureblob.options.CreateContainerOptions; +import org.jclouds.azureblob.options.ListBlobsOptions; +import org.jclouds.azureblob.predicates.validators.ContainerNameValidator; +import org.jclouds.azureblob.xml.AccountNameEnumerationResultsHandler; +import org.jclouds.azureblob.xml.ContainerNameEnumerationResultsHandler; import org.jclouds.azure.storage.domain.BoundedSet; import org.jclouds.azure.storage.filters.SharedKeyLiteAuthentication; import org.jclouds.azure.storage.options.ListOptions; @@ -86,7 +86,7 @@ import com.google.common.util.concurrent.ListenableFuture; @Path("/") public interface AzureBlobAsyncClient { - public org.jclouds.azure.storage.blob.domain.AzureBlob newBlob(); + public org.jclouds.azureblob.domain.AzureBlob newBlob(); /** * @see AzureBlobClient#listContainers @@ -195,7 +195,7 @@ public interface AzureBlobAsyncClient { @ResponseParser(ParseETagHeader.class) ListenableFuture putBlob( @PathParam("container") @ParamValidators( { ContainerNameValidator.class }) String container, - @PathParam("name") @ParamParser(BlobName.class) @BinderParam(BindAzureBlobMetadataToRequest.class) org.jclouds.azure.storage.blob.domain.AzureBlob object); + @PathParam("name") @ParamParser(BlobName.class) @BinderParam(BindAzureBlobMetadataToRequest.class) org.jclouds.azureblob.domain.AzureBlob object); /** * @see AzureBlobClient#getBlob @@ -204,7 +204,7 @@ public interface AzureBlobAsyncClient { @ResponseParser(ParseBlobFromHeadersAndHttpContent.class) @ExceptionParser(ReturnNullOnKeyNotFound.class) @Path("{container}/{name}") - ListenableFuture getBlob( + ListenableFuture getBlob( @PathParam("container") @ParamValidators( { ContainerNameValidator.class }) String container, @PathParam("name") String name, GetOptions... options); diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/AzureBlobClient.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobClient.java similarity index 94% rename from azure/src/main/java/org/jclouds/azure/storage/blob/AzureBlobClient.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobClient.java index 137e2d37da..9a58952f7f 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/AzureBlobClient.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobClient.java @@ -17,17 +17,17 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob; +package org.jclouds.azureblob; import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; -import org.jclouds.azure.storage.blob.domain.BlobProperties; -import org.jclouds.azure.storage.blob.domain.ContainerProperties; -import org.jclouds.azure.storage.blob.domain.ListBlobsResponse; -import org.jclouds.azure.storage.blob.options.CreateContainerOptions; -import org.jclouds.azure.storage.blob.options.ListBlobsOptions; +import org.jclouds.azureblob.domain.BlobProperties; +import org.jclouds.azureblob.domain.ContainerProperties; +import org.jclouds.azureblob.domain.ListBlobsResponse; +import org.jclouds.azureblob.options.CreateContainerOptions; +import org.jclouds.azureblob.options.ListBlobsOptions; import org.jclouds.azure.storage.domain.BoundedSet; import org.jclouds.azure.storage.options.ListOptions; import org.jclouds.blobstore.ContainerNotFoundException; @@ -48,7 +48,7 @@ import java.util.concurrent.Future; */ @Timeout(duration = 90, timeUnit = TimeUnit.SECONDS) public interface AzureBlobClient { - public org.jclouds.azure.storage.blob.domain.AzureBlob newBlob(); + public org.jclouds.azureblob.domain.AzureBlob newBlob(); /** * The List Containers operation returns a list of the containers under the specified identity. @@ -204,14 +204,14 @@ public interface AzureBlobClient { * longer than 10 minutes per MB on average, the operation will timeout. */ @Timeout(duration = 10 * 64, timeUnit = TimeUnit.MINUTES) - String putBlob(String container, org.jclouds.azure.storage.blob.domain.AzureBlob object); + String putBlob(String container, org.jclouds.azureblob.domain.AzureBlob object); /** * The Get Blob operation reads or downloads a blob from the system, including its metadata and * properties. */ @Timeout(duration = 10 * 64, timeUnit = TimeUnit.MINUTES) - org.jclouds.azure.storage.blob.domain.AzureBlob getBlob(String container, String name, + org.jclouds.azureblob.domain.AzureBlob getBlob(String container, String name, GetOptions... options); /** diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/AzureBlobContextBuilder.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobContextBuilder.java old mode 100755 new mode 100644 similarity index 91% rename from azure/src/main/java/org/jclouds/azure/storage/blob/AzureBlobContextBuilder.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobContextBuilder.java index 43a67a77ad..ec681618d8 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/AzureBlobContextBuilder.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobContextBuilder.java @@ -17,13 +17,13 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob; +package org.jclouds.azureblob; import java.util.List; import java.util.Properties; -import org.jclouds.azure.storage.blob.blobstore.config.AzureBlobStoreContextModule; -import org.jclouds.azure.storage.blob.config.AzureBlobRestClientModule; +import org.jclouds.azureblob.blobstore.config.AzureBlobStoreContextModule; +import org.jclouds.azureblob.config.AzureBlobRestClientModule; import org.jclouds.blobstore.BlobStoreContextBuilder; import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule; import org.jclouds.logging.jdk.config.JDKLoggingModule; diff --git a/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobPropertiesBuilder.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobPropertiesBuilder.java new file mode 100644 index 0000000000..1eeacd790d --- /dev/null +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobPropertiesBuilder.java @@ -0,0 +1,49 @@ +/** + * + * Copyright (C) 2010 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ==================================================================== + */ + +package org.jclouds.azureblob; + +import static org.jclouds.Constants.PROPERTY_API_VERSION; +import static org.jclouds.Constants.PROPERTY_ENDPOINT; +import static org.jclouds.blobstore.reference.BlobStoreConstants.PROPERTY_USER_METADATA_PREFIX; + +import java.util.Properties; + +import org.jclouds.azure.storage.AzureStoragePropertiesBuilder; + +/** + * Builds properties used in AzureBlob Connections + * + * @author Adrian Cole + */ +public class AzureBlobPropertiesBuilder extends AzureStoragePropertiesBuilder { + @Override + protected Properties defaultProperties() { + Properties properties = super.defaultProperties(); + properties.setProperty(PROPERTY_USER_METADATA_PREFIX, "x-ms-meta-"); + properties.setProperty(PROPERTY_API_VERSION, "2009-09-19"); + properties.setProperty(PROPERTY_ENDPOINT, "https://{identity}.blob.core.windows.net"); + return properties; + } + + public AzureBlobPropertiesBuilder(Properties properties) { + super(properties); + } + +} diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/AzureBlobUtil.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobUtil.java similarity index 98% rename from azure/src/main/java/org/jclouds/azure/storage/blob/AzureBlobUtil.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobUtil.java index 3b9ede2b5a..99649281d6 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/AzureBlobUtil.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobUtil.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob; +package org.jclouds.azureblob; import java.net.URI; diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/binders/BindAzureBlobMetadataToRequest.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/binders/BindAzureBlobMetadataToRequest.java similarity index 94% rename from azure/src/main/java/org/jclouds/azure/storage/blob/binders/BindAzureBlobMetadataToRequest.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/binders/BindAzureBlobMetadataToRequest.java index d5265f5aca..3014b45bf0 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/binders/BindAzureBlobMetadataToRequest.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/binders/BindAzureBlobMetadataToRequest.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.binders; +package org.jclouds.azureblob.binders; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; @@ -26,8 +26,8 @@ import javax.inject.Inject; import javax.inject.Singleton; import javax.ws.rs.core.HttpHeaders; -import org.jclouds.azure.storage.blob.blobstore.functions.AzureBlobToBlob; -import org.jclouds.azure.storage.blob.domain.AzureBlob; +import org.jclouds.azureblob.blobstore.functions.AzureBlobToBlob; +import org.jclouds.azureblob.domain.AzureBlob; import org.jclouds.blobstore.binders.BindUserMetadataToHeadersWithPrefix; import org.jclouds.http.HttpRequest; import org.jclouds.http.utils.ModifyRequest; diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/AzureAsyncBlobStore.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/AzureAsyncBlobStore.java similarity index 90% rename from azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/AzureAsyncBlobStore.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/AzureAsyncBlobStore.java index 5fbc2b3b1f..13f17e9368 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/AzureAsyncBlobStore.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/AzureAsyncBlobStore.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.blobstore; +package org.jclouds.azureblob.blobstore; import static com.google.common.base.Preconditions.checkNotNull; import static org.jclouds.azure.storage.options.ListOptions.Builder.includeMetadata; @@ -30,18 +30,18 @@ import javax.inject.Named; import javax.inject.Singleton; import org.jclouds.Constants; -import org.jclouds.azure.storage.blob.AzureBlobAsyncClient; -import org.jclouds.azure.storage.blob.blobstore.functions.AzureBlobToBlob; -import org.jclouds.azure.storage.blob.blobstore.functions.BlobPropertiesToBlobMetadata; -import org.jclouds.azure.storage.blob.blobstore.functions.BlobToAzureBlob; -import org.jclouds.azure.storage.blob.blobstore.functions.ContainerToResourceMetadata; -import org.jclouds.azure.storage.blob.blobstore.functions.ListBlobsResponseToResourceList; -import org.jclouds.azure.storage.blob.blobstore.functions.ListOptionsToListBlobsOptions; -import org.jclouds.azure.storage.blob.domain.AzureBlob; -import org.jclouds.azure.storage.blob.domain.BlobProperties; -import org.jclouds.azure.storage.blob.domain.ContainerProperties; -import org.jclouds.azure.storage.blob.domain.ListBlobsResponse; -import org.jclouds.azure.storage.blob.options.ListBlobsOptions; +import org.jclouds.azureblob.AzureBlobAsyncClient; +import org.jclouds.azureblob.blobstore.functions.AzureBlobToBlob; +import org.jclouds.azureblob.blobstore.functions.BlobPropertiesToBlobMetadata; +import org.jclouds.azureblob.blobstore.functions.BlobToAzureBlob; +import org.jclouds.azureblob.blobstore.functions.ContainerToResourceMetadata; +import org.jclouds.azureblob.blobstore.functions.ListBlobsResponseToResourceList; +import org.jclouds.azureblob.blobstore.functions.ListOptionsToListBlobsOptions; +import org.jclouds.azureblob.domain.AzureBlob; +import org.jclouds.azureblob.domain.BlobProperties; +import org.jclouds.azureblob.domain.ContainerProperties; +import org.jclouds.azureblob.domain.ListBlobsResponse; +import org.jclouds.azureblob.options.ListBlobsOptions; import org.jclouds.azure.storage.domain.BoundedSet; import org.jclouds.blobstore.BlobStoreContext; import org.jclouds.blobstore.domain.Blob; diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/AzureBlobRequestSigner.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSigner.java similarity index 91% rename from azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/AzureBlobRequestSigner.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSigner.java index fd5f544976..23e21a417c 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/AzureBlobRequestSigner.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSigner.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.blobstore; +package org.jclouds.azureblob.blobstore; import static com.google.common.base.Preconditions.checkNotNull; import static org.jclouds.blobstore.util.BlobStoreUtils.cleanRequest; @@ -27,9 +27,9 @@ import java.lang.reflect.Method; import javax.inject.Inject; import javax.inject.Singleton; -import org.jclouds.azure.storage.blob.AzureBlobAsyncClient; -import org.jclouds.azure.storage.blob.blobstore.functions.BlobToAzureBlob; -import org.jclouds.azure.storage.blob.domain.AzureBlob; +import org.jclouds.azureblob.AzureBlobAsyncClient; +import org.jclouds.azureblob.blobstore.functions.BlobToAzureBlob; +import org.jclouds.azureblob.domain.AzureBlob; import org.jclouds.blobstore.BlobRequestSigner; import org.jclouds.blobstore.domain.Blob; import org.jclouds.http.HttpRequest; @@ -74,4 +74,4 @@ public class AzureBlobRequestSigner implements BlobRequestSigner { return cleanRequest(processor.createRequest(deleteMethod, container, name)); } -} \ No newline at end of file +} diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/AzureBlobStore.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/AzureBlobStore.java similarity index 91% rename from azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/AzureBlobStore.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/AzureBlobStore.java index 7a70b8c66f..3764648c31 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/AzureBlobStore.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/AzureBlobStore.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.blobstore; +package org.jclouds.azureblob.blobstore; import static com.google.common.base.Preconditions.checkNotNull; import static org.jclouds.azure.storage.options.ListOptions.Builder.includeMetadata; @@ -27,15 +27,15 @@ import java.util.Set; import javax.inject.Inject; import javax.inject.Singleton; -import org.jclouds.azure.storage.blob.AzureBlobClient; -import org.jclouds.azure.storage.blob.blobstore.functions.AzureBlobToBlob; -import org.jclouds.azure.storage.blob.blobstore.functions.BlobPropertiesToBlobMetadata; -import org.jclouds.azure.storage.blob.blobstore.functions.BlobToAzureBlob; -import org.jclouds.azure.storage.blob.blobstore.functions.ContainerToResourceMetadata; -import org.jclouds.azure.storage.blob.blobstore.functions.ListBlobsResponseToResourceList; -import org.jclouds.azure.storage.blob.blobstore.functions.ListOptionsToListBlobsOptions; -import org.jclouds.azure.storage.blob.domain.ContainerProperties; -import org.jclouds.azure.storage.blob.options.ListBlobsOptions; +import org.jclouds.azureblob.AzureBlobClient; +import org.jclouds.azureblob.blobstore.functions.AzureBlobToBlob; +import org.jclouds.azureblob.blobstore.functions.BlobPropertiesToBlobMetadata; +import org.jclouds.azureblob.blobstore.functions.BlobToAzureBlob; +import org.jclouds.azureblob.blobstore.functions.ContainerToResourceMetadata; +import org.jclouds.azureblob.blobstore.functions.ListBlobsResponseToResourceList; +import org.jclouds.azureblob.blobstore.functions.ListOptionsToListBlobsOptions; +import org.jclouds.azureblob.domain.ContainerProperties; +import org.jclouds.azureblob.options.ListBlobsOptions; import org.jclouds.azure.storage.domain.BoundedSet; import org.jclouds.blobstore.BlobStoreContext; import org.jclouds.blobstore.domain.Blob; diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/config/AzureBlobStoreContextModule.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/config/AzureBlobStoreContextModule.java old mode 100755 new mode 100644 similarity index 86% rename from azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/config/AzureBlobStoreContextModule.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/config/AzureBlobStoreContextModule.java index a8b362745d..1c55ee4d57 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/config/AzureBlobStoreContextModule.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/config/AzureBlobStoreContextModule.java @@ -17,18 +17,18 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.blobstore.config; +package org.jclouds.azureblob.blobstore.config; import java.util.Set; import javax.inject.Singleton; -import org.jclouds.azure.storage.blob.AzureBlobAsyncClient; -import org.jclouds.azure.storage.blob.AzureBlobClient; -import org.jclouds.azure.storage.blob.blobstore.AzureAsyncBlobStore; -import org.jclouds.azure.storage.blob.blobstore.AzureBlobRequestSigner; -import org.jclouds.azure.storage.blob.blobstore.AzureBlobStore; -import org.jclouds.azure.storage.blob.blobstore.strategy.FindMD5InBlobProperties; +import org.jclouds.azureblob.AzureBlobAsyncClient; +import org.jclouds.azureblob.AzureBlobClient; +import org.jclouds.azureblob.blobstore.AzureAsyncBlobStore; +import org.jclouds.azureblob.blobstore.AzureBlobRequestSigner; +import org.jclouds.azureblob.blobstore.AzureBlobStore; +import org.jclouds.azureblob.blobstore.strategy.FindMD5InBlobProperties; import org.jclouds.blobstore.AsyncBlobStore; import org.jclouds.blobstore.BlobRequestSigner; import org.jclouds.blobstore.BlobStore; diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/functions/AzureBlobToBlob.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/functions/AzureBlobToBlob.java similarity index 93% rename from azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/functions/AzureBlobToBlob.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/functions/AzureBlobToBlob.java index 56322f5a0a..08cacf7602 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/functions/AzureBlobToBlob.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/functions/AzureBlobToBlob.java @@ -17,14 +17,14 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.blobstore.functions; +package org.jclouds.azureblob.blobstore.functions; import static com.google.common.base.Preconditions.checkNotNull; import javax.inject.Inject; import javax.inject.Singleton; -import org.jclouds.azure.storage.blob.domain.AzureBlob; +import org.jclouds.azureblob.domain.AzureBlob; import org.jclouds.blobstore.domain.Blob; import org.jclouds.blobstore.domain.Blob.Factory; diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/functions/BlobMetadataToBlobProperties.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/functions/BlobMetadataToBlobProperties.java similarity index 89% rename from azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/functions/BlobMetadataToBlobProperties.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/functions/BlobMetadataToBlobProperties.java index 9dd4bf9e0a..b9e8dd0fa7 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/functions/BlobMetadataToBlobProperties.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/functions/BlobMetadataToBlobProperties.java @@ -17,14 +17,14 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.blobstore.functions; +package org.jclouds.azureblob.blobstore.functions; import java.util.Map.Entry; import javax.inject.Singleton; -import org.jclouds.azure.storage.blob.domain.MutableBlobProperties; -import org.jclouds.azure.storage.blob.domain.internal.MutableBlobPropertiesImpl; +import org.jclouds.azureblob.domain.MutableBlobProperties; +import org.jclouds.azureblob.domain.internal.MutableBlobPropertiesImpl; import org.jclouds.blobstore.domain.BlobMetadata; import org.jclouds.http.HttpUtils; @@ -50,4 +50,4 @@ public class BlobMetadataToBlobProperties implements Function { object.setAllHeaders(from.getAllHeaders()); return object; } -} \ No newline at end of file +} diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/functions/ContainerToResourceMetadata.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/functions/ContainerToResourceMetadata.java similarity index 93% rename from azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/functions/ContainerToResourceMetadata.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/functions/ContainerToResourceMetadata.java index 21442ab542..b3abfa2610 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/functions/ContainerToResourceMetadata.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/functions/ContainerToResourceMetadata.java @@ -17,12 +17,12 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.blobstore.functions; +package org.jclouds.azureblob.blobstore.functions; import javax.inject.Inject; import javax.inject.Singleton; -import org.jclouds.azure.storage.blob.domain.ContainerProperties; +import org.jclouds.azureblob.domain.ContainerProperties; import org.jclouds.blobstore.domain.MutableStorageMetadata; import org.jclouds.blobstore.domain.StorageMetadata; import org.jclouds.blobstore.domain.StorageType; @@ -55,4 +55,4 @@ public class ContainerToResourceMetadata implements Function(contents, from.getNextMarker()); } -} \ No newline at end of file +} diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/functions/ListOptionsToListBlobsOptions.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/functions/ListOptionsToListBlobsOptions.java similarity index 93% rename from azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/functions/ListOptionsToListBlobsOptions.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/functions/ListOptionsToListBlobsOptions.java index bd8a92fac3..3f057755ad 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/functions/ListOptionsToListBlobsOptions.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/functions/ListOptionsToListBlobsOptions.java @@ -17,13 +17,13 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.blobstore.functions; +package org.jclouds.azureblob.blobstore.functions; import static com.google.common.base.Preconditions.checkNotNull; import javax.inject.Singleton; -import org.jclouds.azure.storage.blob.options.ListBlobsOptions; +import org.jclouds.azureblob.options.ListBlobsOptions; import org.jclouds.blobstore.options.ListContainerOptions; import com.google.common.base.Function; @@ -54,4 +54,4 @@ public class ListOptionsToListBlobsOptions implements } return httpOptions; } -} \ No newline at end of file +} diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/strategy/FindMD5InBlobProperties.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/strategy/FindMD5InBlobProperties.java similarity index 93% rename from azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/strategy/FindMD5InBlobProperties.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/strategy/FindMD5InBlobProperties.java index e2e18d61be..9f13bce8ec 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/blobstore/strategy/FindMD5InBlobProperties.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/strategy/FindMD5InBlobProperties.java @@ -17,15 +17,15 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.blobstore.strategy; +package org.jclouds.azureblob.blobstore.strategy; import java.util.Arrays; import javax.inject.Inject; import javax.inject.Singleton; -import org.jclouds.azure.storage.blob.AzureBlobClient; -import org.jclouds.azure.storage.blob.domain.BlobProperties; +import org.jclouds.azureblob.AzureBlobClient; +import org.jclouds.azureblob.domain.BlobProperties; import org.jclouds.blobstore.domain.BlobMetadata; import org.jclouds.blobstore.functions.ObjectMD5; import org.jclouds.blobstore.internal.BlobRuntimeException; @@ -72,4 +72,4 @@ public class FindMD5InBlobProperties implements ContainsValueInListStrategy { } } -} \ No newline at end of file +} diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/config/AzureBlobModule.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/config/AzureBlobModule.java similarity index 89% rename from azure/src/main/java/org/jclouds/azure/storage/blob/config/AzureBlobModule.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/config/AzureBlobModule.java index 8e7a3be88a..2630168cdf 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/config/AzureBlobModule.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/config/AzureBlobModule.java @@ -17,14 +17,14 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.config; +package org.jclouds.azureblob.config; import javax.inject.Inject; import javax.inject.Provider; -import org.jclouds.azure.storage.blob.domain.AzureBlob; -import org.jclouds.azure.storage.blob.domain.MutableBlobProperties; -import org.jclouds.azure.storage.blob.domain.internal.AzureBlobImpl; +import org.jclouds.azureblob.domain.AzureBlob; +import org.jclouds.azureblob.domain.MutableBlobProperties; +import org.jclouds.azureblob.domain.internal.AzureBlobImpl; import org.jclouds.blobstore.config.BlobStoreObjectModule; import com.google.inject.AbstractModule; @@ -63,4 +63,4 @@ public class AzureBlobModule extends AbstractModule { return factory.create(null); } -} \ No newline at end of file +} diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/config/AzureBlobRestClientModule.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/config/AzureBlobRestClientModule.java similarity index 59% rename from azure/src/main/java/org/jclouds/azure/storage/blob/config/AzureBlobRestClientModule.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/config/AzureBlobRestClientModule.java index ef1fe6cc61..bbc100fd1b 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/config/AzureBlobRestClientModule.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/config/AzureBlobRestClientModule.java @@ -17,12 +17,17 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.config; +package org.jclouds.azureblob.config; -import org.jclouds.azure.storage.blob.AzureBlobAsyncClient; -import org.jclouds.azure.storage.blob.AzureBlobClient; import org.jclouds.azure.storage.config.AzureStorageRestClientModule; +import org.jclouds.azureblob.AzureBlobAsyncClient; +import org.jclouds.azureblob.AzureBlobClient; +import org.jclouds.azureblob.handlers.ParseAzureBlobErrorFromXmlContent; +import org.jclouds.http.HttpErrorHandler; import org.jclouds.http.RequiresHttp; +import org.jclouds.http.annotation.ClientError; +import org.jclouds.http.annotation.Redirection; +import org.jclouds.http.annotation.ServerError; import org.jclouds.rest.ConfiguresRestClient; /** @@ -32,8 +37,7 @@ import org.jclouds.rest.ConfiguresRestClient; */ @ConfiguresRestClient @RequiresHttp -public class AzureBlobRestClientModule extends - AzureStorageRestClientModule { +public class AzureBlobRestClientModule extends AzureStorageRestClientModule { public AzureBlobRestClientModule() { super(AzureBlobClient.class, AzureBlobAsyncClient.class); @@ -45,4 +49,11 @@ public class AzureBlobRestClientModule extends super.configure(); } -} \ No newline at end of file + @Override + protected void bindErrorHandlers() { + bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(ParseAzureBlobErrorFromXmlContent.class); + bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(ParseAzureBlobErrorFromXmlContent.class); + bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(ParseAzureBlobErrorFromXmlContent.class); + } + +} diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/AzureBlob.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/AzureBlob.java similarity index 97% rename from azure/src/main/java/org/jclouds/azure/storage/blob/domain/AzureBlob.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/domain/AzureBlob.java index b708bec545..b78f70f1c4 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/AzureBlob.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/AzureBlob.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.domain; +package org.jclouds.azureblob.domain; import javax.annotation.Nullable; @@ -50,4 +50,4 @@ public interface AzureBlob extends PayloadEnclosing, Comparable { Multimap getAllHeaders(); void setAllHeaders(Multimap allHeaders); -} \ No newline at end of file +} diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/BlobProperties.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/BlobProperties.java similarity index 96% rename from azure/src/main/java/org/jclouds/azure/storage/blob/domain/BlobProperties.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/domain/BlobProperties.java index ce0c1aa316..ee630cbb6f 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/BlobProperties.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/BlobProperties.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.domain; +package org.jclouds.azureblob.domain; import java.net.URI; import java.util.Date; diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/BlobType.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/BlobType.java similarity index 96% rename from azure/src/main/java/org/jclouds/azure/storage/blob/domain/BlobType.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/domain/BlobType.java index f827aa36bc..69e254a17e 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/BlobType.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/BlobType.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.domain; +package org.jclouds.azureblob.domain; import static com.google.common.base.Preconditions.checkNotNull; @@ -45,4 +45,4 @@ public enum BlobType { return UNRECOGNIZED; } } -} \ No newline at end of file +} diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/ContainerProperties.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/ContainerProperties.java similarity index 95% rename from azure/src/main/java/org/jclouds/azure/storage/blob/domain/ContainerProperties.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/domain/ContainerProperties.java index 463cee546f..96c2a4fb6b 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/ContainerProperties.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/ContainerProperties.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.domain; +package org.jclouds.azureblob.domain; import java.net.URI; import java.util.Date; diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/LeaseStatus.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/LeaseStatus.java similarity index 96% rename from azure/src/main/java/org/jclouds/azure/storage/blob/domain/LeaseStatus.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/domain/LeaseStatus.java index 70b7c78baa..916edf94b5 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/LeaseStatus.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/LeaseStatus.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.domain; +package org.jclouds.azureblob.domain; import static com.google.common.base.Preconditions.checkNotNull; @@ -45,4 +45,4 @@ public enum LeaseStatus { return UNRECOGNIZED; } } -} \ No newline at end of file +} diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/ListBlobsResponse.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/ListBlobsResponse.java similarity index 95% rename from azure/src/main/java/org/jclouds/azure/storage/blob/domain/ListBlobsResponse.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/domain/ListBlobsResponse.java index 7eb4185ce2..1f891ef1d4 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/ListBlobsResponse.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/ListBlobsResponse.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.domain; +package org.jclouds.azureblob.domain; import java.util.Set; @@ -32,4 +32,4 @@ public interface ListBlobsResponse extends BoundedSet { String getDelimiter(); Set getBlobPrefixes(); -} \ No newline at end of file +} diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/MutableBlobProperties.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/MutableBlobProperties.java similarity index 92% rename from azure/src/main/java/org/jclouds/azure/storage/blob/domain/MutableBlobProperties.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/domain/MutableBlobProperties.java index c45730b3a3..706b30b085 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/MutableBlobProperties.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/MutableBlobProperties.java @@ -17,13 +17,13 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.domain; +package org.jclouds.azureblob.domain; import java.net.URI; import java.util.Date; import java.util.Map; -import org.jclouds.azure.storage.blob.domain.internal.MutableBlobPropertiesImpl; +import org.jclouds.azureblob.domain.internal.MutableBlobPropertiesImpl; import org.jclouds.io.MutableContentMetadata; import com.google.inject.ImplementedBy; diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/MutableContainerPropertiesWithMetadata.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/MutableContainerPropertiesWithMetadata.java similarity index 91% rename from azure/src/main/java/org/jclouds/azure/storage/blob/domain/MutableContainerPropertiesWithMetadata.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/domain/MutableContainerPropertiesWithMetadata.java index 6db8431847..977b1654d8 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/MutableContainerPropertiesWithMetadata.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/MutableContainerPropertiesWithMetadata.java @@ -17,13 +17,13 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.domain; +package org.jclouds.azureblob.domain; import java.net.URI; import java.util.Date; import java.util.Map; -import org.jclouds.azure.storage.blob.domain.internal.MutableContainerPropertiesWithMetadataImpl; +import org.jclouds.azureblob.domain.internal.MutableContainerPropertiesWithMetadataImpl; import com.google.inject.ImplementedBy; diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/internal/AzureBlobImpl.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/internal/AzureBlobImpl.java similarity index 94% rename from azure/src/main/java/org/jclouds/azure/storage/blob/domain/internal/AzureBlobImpl.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/domain/internal/AzureBlobImpl.java index 69d1cb369d..3d3b868455 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/internal/AzureBlobImpl.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/internal/AzureBlobImpl.java @@ -17,14 +17,14 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.domain.internal; +package org.jclouds.azureblob.domain.internal; import static com.google.common.base.Preconditions.checkNotNull; import javax.inject.Inject; -import org.jclouds.azure.storage.blob.domain.AzureBlob; -import org.jclouds.azure.storage.blob.domain.MutableBlobProperties; +import org.jclouds.azureblob.domain.AzureBlob; +import org.jclouds.azureblob.domain.MutableBlobProperties; import org.jclouds.http.internal.PayloadEnclosingImpl; import org.jclouds.io.Payload; diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/internal/BlobPropertiesImpl.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/internal/BlobPropertiesImpl.java similarity index 96% rename from azure/src/main/java/org/jclouds/azure/storage/blob/domain/internal/BlobPropertiesImpl.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/domain/internal/BlobPropertiesImpl.java index e84ed48e84..ec3b97ebfa 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/internal/BlobPropertiesImpl.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/internal/BlobPropertiesImpl.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.domain.internal; +package org.jclouds.azureblob.domain.internal; import static com.google.common.base.Preconditions.checkNotNull; @@ -28,9 +28,9 @@ import java.util.Map; import javax.annotation.Nullable; -import org.jclouds.azure.storage.blob.domain.BlobProperties; -import org.jclouds.azure.storage.blob.domain.BlobType; -import org.jclouds.azure.storage.blob.domain.LeaseStatus; +import org.jclouds.azureblob.domain.BlobProperties; +import org.jclouds.azureblob.domain.BlobType; +import org.jclouds.azureblob.domain.LeaseStatus; import org.jclouds.io.ContentMetadata; import org.jclouds.io.payloads.BaseImmutableContentMetadata; @@ -213,4 +213,4 @@ public class BlobPropertiesImpl implements Serializable, BlobProperties { + ", lastModified=" + lastModified + "]"; } -} \ No newline at end of file +} diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/internal/ContainerPropertiesImpl.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/internal/ContainerPropertiesImpl.java similarity index 96% rename from azure/src/main/java/org/jclouds/azure/storage/blob/domain/internal/ContainerPropertiesImpl.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/domain/internal/ContainerPropertiesImpl.java index 5cab0f9ed5..91b2e9805e 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/internal/ContainerPropertiesImpl.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/internal/ContainerPropertiesImpl.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.domain.internal; +package org.jclouds.azureblob.domain.internal; import static com.google.common.base.Preconditions.checkNotNull; @@ -26,7 +26,7 @@ import java.net.URI; import java.util.Date; import java.util.Map; -import org.jclouds.azure.storage.blob.domain.ContainerProperties; +import org.jclouds.azureblob.domain.ContainerProperties; import com.google.common.collect.Maps; @@ -141,4 +141,4 @@ public class ContainerPropertiesImpl implements Serializable, ContainerPropertie return true; } -} \ No newline at end of file +} diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/internal/HashSetListBlobsResponse.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/internal/HashSetListBlobsResponse.java similarity index 94% rename from azure/src/main/java/org/jclouds/azure/storage/blob/domain/internal/HashSetListBlobsResponse.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/domain/internal/HashSetListBlobsResponse.java index d3f7226caa..5a5ee3ff2e 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/internal/HashSetListBlobsResponse.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/internal/HashSetListBlobsResponse.java @@ -17,13 +17,13 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.domain.internal; +package org.jclouds.azureblob.domain.internal; import java.net.URI; import java.util.Set; -import org.jclouds.azure.storage.blob.domain.BlobProperties; -import org.jclouds.azure.storage.blob.domain.ListBlobsResponse; +import org.jclouds.azureblob.domain.BlobProperties; +import org.jclouds.azureblob.domain.ListBlobsResponse; import org.jclouds.azure.storage.domain.internal.BoundedHashSet; import com.google.common.collect.Iterables; diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/internal/MutableBlobPropertiesImpl.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/internal/MutableBlobPropertiesImpl.java similarity index 95% rename from azure/src/main/java/org/jclouds/azure/storage/blob/domain/internal/MutableBlobPropertiesImpl.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/domain/internal/MutableBlobPropertiesImpl.java index bf3cd4e15e..3d97ed8a3e 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/internal/MutableBlobPropertiesImpl.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/internal/MutableBlobPropertiesImpl.java @@ -17,17 +17,17 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.domain.internal; +package org.jclouds.azureblob.domain.internal; import java.io.Serializable; import java.net.URI; import java.util.Date; import java.util.Map; -import org.jclouds.azure.storage.blob.domain.BlobProperties; -import org.jclouds.azure.storage.blob.domain.BlobType; -import org.jclouds.azure.storage.blob.domain.LeaseStatus; -import org.jclouds.azure.storage.blob.domain.MutableBlobProperties; +import org.jclouds.azureblob.domain.BlobProperties; +import org.jclouds.azureblob.domain.BlobType; +import org.jclouds.azureblob.domain.LeaseStatus; +import org.jclouds.azureblob.domain.MutableBlobProperties; import org.jclouds.http.HttpUtils; import org.jclouds.io.MutableContentMetadata; import org.jclouds.io.payloads.BaseMutableContentMetadata; @@ -240,4 +240,4 @@ public class MutableBlobPropertiesImpl implements Serializable, MutableBlobPrope } -} \ No newline at end of file +} diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/internal/MutableContainerPropertiesWithMetadataImpl.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/internal/MutableContainerPropertiesWithMetadataImpl.java similarity index 95% rename from azure/src/main/java/org/jclouds/azure/storage/blob/domain/internal/MutableContainerPropertiesWithMetadataImpl.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/domain/internal/MutableContainerPropertiesWithMetadataImpl.java index 892fa7c138..0d0a605555 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/domain/internal/MutableContainerPropertiesWithMetadataImpl.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/domain/internal/MutableContainerPropertiesWithMetadataImpl.java @@ -17,15 +17,15 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.domain.internal; +package org.jclouds.azureblob.domain.internal; import java.io.Serializable; import java.net.URI; import java.util.Date; import java.util.Map; -import org.jclouds.azure.storage.blob.domain.ContainerProperties; -import org.jclouds.azure.storage.blob.domain.MutableContainerPropertiesWithMetadata; +import org.jclouds.azureblob.domain.ContainerProperties; +import org.jclouds.azureblob.domain.MutableContainerPropertiesWithMetadata; import com.google.common.collect.Maps; @@ -169,4 +169,4 @@ public class MutableContainerPropertiesWithMetadataImpl implements Serializable, return false; return true; } -} \ No newline at end of file +} diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/functions/BlobName.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/functions/BlobName.java similarity index 90% rename from azure/src/main/java/org/jclouds/azure/storage/blob/functions/BlobName.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/functions/BlobName.java index 63fc220afb..256a2fca9a 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/functions/BlobName.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/functions/BlobName.java @@ -17,9 +17,9 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.functions; +package org.jclouds.azureblob.functions; -import org.jclouds.azure.storage.blob.domain.AzureBlob; +import org.jclouds.azureblob.domain.AzureBlob; import com.google.common.base.Function; @@ -33,4 +33,4 @@ public class BlobName implements Function { return ((AzureBlob) from).getProperties().getName(); } -} \ No newline at end of file +} diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/functions/ParseBlobFromHeadersAndHttpContent.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/functions/ParseBlobFromHeadersAndHttpContent.java similarity index 92% rename from azure/src/main/java/org/jclouds/azure/storage/blob/functions/ParseBlobFromHeadersAndHttpContent.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/functions/ParseBlobFromHeadersAndHttpContent.java index bf058b8f4a..e578ed0176 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/functions/ParseBlobFromHeadersAndHttpContent.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/functions/ParseBlobFromHeadersAndHttpContent.java @@ -17,13 +17,13 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.functions; +package org.jclouds.azureblob.functions; import javax.inject.Inject; import javax.inject.Singleton; -import org.jclouds.azure.storage.blob.domain.AzureBlob; -import org.jclouds.azure.storage.blob.domain.MutableBlobProperties; +import org.jclouds.azureblob.domain.AzureBlob; +import org.jclouds.azureblob.domain.MutableBlobProperties; import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpResponse; import org.jclouds.rest.InvocationContext; @@ -64,4 +64,4 @@ public class ParseBlobFromHeadersAndHttpContent implements Function + * + * ==================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ==================================================================== + */ + +package org.jclouds.azureblob.handlers; + +import javax.inject.Inject; +import javax.inject.Singleton; + +import org.jclouds.azure.storage.domain.AzureStorageError; +import org.jclouds.azure.storage.handlers.ParseAzureStorageErrorFromXmlContent; +import org.jclouds.azure.storage.util.AzureStorageUtils; +import org.jclouds.blobstore.ContainerNotFoundException; +import org.jclouds.blobstore.KeyNotFoundException; +import org.jclouds.http.HttpCommand; +import org.jclouds.http.HttpResponse; +import org.jclouds.rest.ResourceNotFoundException; + +/** + * @author Adrian Cole + * + */ +@Singleton +public class ParseAzureBlobErrorFromXmlContent extends ParseAzureStorageErrorFromXmlContent { + + @Inject + ParseAzureBlobErrorFromXmlContent(AzureStorageUtils utils) { + super(utils); + } + + protected Exception refineException(HttpCommand command, HttpResponse response, Exception exception, AzureStorageError error, + String message) { + switch (response.getStatusCode()) { + case 404: + if (!command.getCurrentRequest().getMethod().equals("DELETE")) { + exception = new ResourceNotFoundException(message, exception); + String container = command.getCurrentRequest().getEndpoint().getHost(); + String key = command.getCurrentRequest().getEndpoint().getPath(); + if (key == null || key.equals("/")) + exception = new ContainerNotFoundException(container, message); + else + exception = new KeyNotFoundException(container, key, message); + } + return exception; + default: + return super.refineException(command, response, exception, error, message); + } + } +} \ No newline at end of file diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/options/CreateContainerOptions.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/options/CreateContainerOptions.java similarity index 93% rename from azure/src/main/java/org/jclouds/azure/storage/blob/options/CreateContainerOptions.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/options/CreateContainerOptions.java index 2a117c6438..3339bd0c0b 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/options/CreateContainerOptions.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/options/CreateContainerOptions.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.options; +package org.jclouds.azureblob.options; import org.jclouds.azure.storage.options.CreateOptions; @@ -30,8 +30,8 @@ import com.google.common.collect.Multimap; * mutator (if needed): *

* - * import static org.jclouds.azure.storage.blob.options.CreateContainerOptions.Builder.* - * import org.jclouds.azure.storage.blob.AzureBlobClient; + * import static org.jclouds.azureblob.options.CreateContainerOptions.Builder.* + * import org.jclouds.azureblob.AzureBlobClient; *

* AzureBlobClient connection = // get connection * boolean createdWithPublicAcl = connection.createContainer("containerName", withPublicAcl()); diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/options/ListBlobsOptions.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/options/ListBlobsOptions.java similarity index 95% rename from azure/src/main/java/org/jclouds/azure/storage/blob/options/ListBlobsOptions.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/options/ListBlobsOptions.java index 1b448529b4..e45a70d8db 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/options/ListBlobsOptions.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/options/ListBlobsOptions.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.options; +package org.jclouds.azureblob.options; import org.jclouds.azure.storage.options.ListOptions; @@ -28,8 +28,8 @@ import org.jclouds.azure.storage.options.ListOptions; * needed): *

* - * import static org.jclouds.azure.storage.blob.options.ListBlobsOptions.Builder.* - * import org.jclouds.azure.storage.blob.AzureBlobClient; + * import static org.jclouds.azureblob.options.ListBlobsOptions.Builder.* + * import org.jclouds.azureblob.AzureBlobClient; *

* AzureBlobClient connection = // get connection * Set blobs = connection.listBlobs("containerName", delimiter("/")); diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/predicates/validators/ContainerNameValidator.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/predicates/validators/ContainerNameValidator.java similarity index 97% rename from azure/src/main/java/org/jclouds/azure/storage/blob/predicates/validators/ContainerNameValidator.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/predicates/validators/ContainerNameValidator.java index e1347a6beb..ba20ae5f0c 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/predicates/validators/ContainerNameValidator.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/predicates/validators/ContainerNameValidator.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.predicates.validators; +package org.jclouds.azureblob.predicates.validators; import javax.inject.Inject; @@ -62,4 +62,4 @@ public class ContainerNameValidator extends DnsNameValidator { containerName, reason)); } -} \ No newline at end of file +} diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/xml/AccountNameEnumerationResultsHandler.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/xml/AccountNameEnumerationResultsHandler.java old mode 100755 new mode 100644 similarity index 96% rename from azure/src/main/java/org/jclouds/azure/storage/blob/xml/AccountNameEnumerationResultsHandler.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/xml/AccountNameEnumerationResultsHandler.java index ae3b67e7f8..0f969cae6f --- a/azure/src/main/java/org/jclouds/azure/storage/blob/xml/AccountNameEnumerationResultsHandler.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/xml/AccountNameEnumerationResultsHandler.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.xml; +package org.jclouds.azureblob.xml; import java.net.URI; import java.util.Date; @@ -26,8 +26,8 @@ import java.util.SortedSet; import javax.inject.Inject; -import org.jclouds.azure.storage.blob.domain.ContainerProperties; -import org.jclouds.azure.storage.blob.domain.internal.ContainerPropertiesImpl; +import org.jclouds.azureblob.domain.ContainerProperties; +import org.jclouds.azureblob.domain.internal.ContainerPropertiesImpl; import org.jclouds.azure.storage.domain.BoundedSet; import org.jclouds.azure.storage.domain.internal.BoundedHashSet; import org.jclouds.date.DateService; diff --git a/azure/src/main/java/org/jclouds/azure/storage/blob/xml/ContainerNameEnumerationResultsHandler.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/xml/ContainerNameEnumerationResultsHandler.java similarity index 94% rename from azure/src/main/java/org/jclouds/azure/storage/blob/xml/ContainerNameEnumerationResultsHandler.java rename to providers/azureblob/src/main/java/org/jclouds/azureblob/xml/ContainerNameEnumerationResultsHandler.java index 007b25f7b6..75023df1b7 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/blob/xml/ContainerNameEnumerationResultsHandler.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/xml/ContainerNameEnumerationResultsHandler.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.xml; +package org.jclouds.azureblob.xml; import java.net.URI; import java.util.Date; @@ -26,12 +26,12 @@ import java.util.Set; import javax.inject.Inject; -import org.jclouds.azure.storage.blob.domain.BlobProperties; -import org.jclouds.azure.storage.blob.domain.BlobType; -import org.jclouds.azure.storage.blob.domain.LeaseStatus; -import org.jclouds.azure.storage.blob.domain.ListBlobsResponse; -import org.jclouds.azure.storage.blob.domain.internal.BlobPropertiesImpl; -import org.jclouds.azure.storage.blob.domain.internal.HashSetListBlobsResponse; +import org.jclouds.azureblob.domain.BlobProperties; +import org.jclouds.azureblob.domain.BlobType; +import org.jclouds.azureblob.domain.LeaseStatus; +import org.jclouds.azureblob.domain.ListBlobsResponse; +import org.jclouds.azureblob.domain.internal.BlobPropertiesImpl; +import org.jclouds.azureblob.domain.internal.HashSetListBlobsResponse; import org.jclouds.crypto.CryptoStreams; import org.jclouds.date.DateService; import org.jclouds.http.HttpUtils; diff --git a/azure/src/test/java/org/jclouds/azure/storage/blob/AzureBlobAsyncClientTest.java b/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobAsyncClientTest.java similarity index 95% rename from azure/src/test/java/org/jclouds/azure/storage/blob/AzureBlobAsyncClientTest.java rename to providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobAsyncClientTest.java index 5859743041..7abcc56040 100644 --- a/azure/src/test/java/org/jclouds/azure/storage/blob/AzureBlobAsyncClientTest.java +++ b/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobAsyncClientTest.java @@ -17,9 +17,9 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob; +package org.jclouds.azureblob; -import static org.jclouds.azure.storage.blob.options.CreateContainerOptions.Builder.withPublicAcl; +import static org.jclouds.azureblob.options.CreateContainerOptions.Builder.withPublicAcl; import static org.jclouds.azure.storage.options.ListOptions.Builder.maxResults; import static org.testng.Assert.assertEquals; @@ -28,13 +28,13 @@ import java.lang.reflect.Method; import java.util.Map; import java.util.Properties; -import org.jclouds.azure.storage.blob.functions.ParseBlobFromHeadersAndHttpContent; -import org.jclouds.azure.storage.blob.functions.ParseContainerPropertiesFromHeaders; -import org.jclouds.azure.storage.blob.functions.ReturnFalseIfContainerAlreadyExists; -import org.jclouds.azure.storage.blob.options.CreateContainerOptions; -import org.jclouds.azure.storage.blob.options.ListBlobsOptions; -import org.jclouds.azure.storage.blob.xml.AccountNameEnumerationResultsHandler; -import org.jclouds.azure.storage.blob.xml.ContainerNameEnumerationResultsHandler; +import org.jclouds.azureblob.functions.ParseBlobFromHeadersAndHttpContent; +import org.jclouds.azureblob.functions.ParseContainerPropertiesFromHeaders; +import org.jclouds.azureblob.functions.ReturnFalseIfContainerAlreadyExists; +import org.jclouds.azureblob.options.CreateContainerOptions; +import org.jclouds.azureblob.options.ListBlobsOptions; +import org.jclouds.azureblob.xml.AccountNameEnumerationResultsHandler; +import org.jclouds.azureblob.xml.ContainerNameEnumerationResultsHandler; import org.jclouds.azure.storage.filters.SharedKeyLiteAuthentication; import org.jclouds.azure.storage.options.ListOptions; import org.jclouds.blobstore.functions.ReturnNullOnContainerNotFound; diff --git a/azure/src/test/java/org/jclouds/azure/storage/blob/AzureBlobClientLiveTest.java b/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobClientLiveTest.java similarity index 96% rename from azure/src/test/java/org/jclouds/azure/storage/blob/AzureBlobClientLiveTest.java rename to providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobClientLiveTest.java index 0101e43e5b..6def749a84 100644 --- a/azure/src/test/java/org/jclouds/azure/storage/blob/AzureBlobClientLiveTest.java +++ b/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobClientLiveTest.java @@ -17,11 +17,11 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob; +package org.jclouds.azureblob; import static com.google.common.base.Preconditions.checkNotNull; -import static org.jclouds.azure.storage.blob.options.CreateContainerOptions.Builder.withMetadata; -import static org.jclouds.azure.storage.blob.options.CreateContainerOptions.Builder.withPublicAcl; +import static org.jclouds.azureblob.options.CreateContainerOptions.Builder.withMetadata; +import static org.jclouds.azureblob.options.CreateContainerOptions.Builder.withPublicAcl; import static org.jclouds.azure.storage.options.ListOptions.Builder.includeMetadata; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; @@ -35,11 +35,11 @@ import java.util.Set; import org.jclouds.Constants; import org.jclouds.azure.storage.AzureStorageResponseException; -import org.jclouds.azure.storage.blob.domain.AzureBlob; -import org.jclouds.azure.storage.blob.domain.BlobProperties; -import org.jclouds.azure.storage.blob.domain.ContainerProperties; -import org.jclouds.azure.storage.blob.domain.ListBlobsResponse; -import org.jclouds.azure.storage.blob.options.ListBlobsOptions; +import org.jclouds.azureblob.domain.AzureBlob; +import org.jclouds.azureblob.domain.BlobProperties; +import org.jclouds.azureblob.domain.ContainerProperties; +import org.jclouds.azureblob.domain.ListBlobsResponse; +import org.jclouds.azureblob.options.ListBlobsOptions; import org.jclouds.azure.storage.domain.BoundedSet; import org.jclouds.azure.storage.options.ListOptions; import org.jclouds.blobstore.BlobStoreContext; diff --git a/azure/src/test/java/org/jclouds/azure/storage/blob/binders/BindAzureBlobMetadataToRequestTest.java b/providers/azureblob/src/test/java/org/jclouds/azureblob/binders/BindAzureBlobMetadataToRequestTest.java similarity index 97% rename from azure/src/test/java/org/jclouds/azure/storage/blob/binders/BindAzureBlobMetadataToRequestTest.java rename to providers/azureblob/src/test/java/org/jclouds/azureblob/binders/BindAzureBlobMetadataToRequestTest.java index 446244a768..ce79bc655c 100644 --- a/azure/src/test/java/org/jclouds/azure/storage/blob/binders/BindAzureBlobMetadataToRequestTest.java +++ b/providers/azureblob/src/test/java/org/jclouds/azureblob/binders/BindAzureBlobMetadataToRequestTest.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.binders; +package org.jclouds.azureblob.binders; import static org.testng.Assert.assertEquals; @@ -27,8 +27,8 @@ import java.util.Properties; import javax.ws.rs.HttpMethod; -import org.jclouds.azure.storage.blob.AzureBlobAsyncClient; -import org.jclouds.azure.storage.blob.domain.AzureBlob; +import org.jclouds.azureblob.AzureBlobAsyncClient; +import org.jclouds.azureblob.domain.AzureBlob; import org.jclouds.http.HttpRequest; import org.jclouds.io.Payload; import org.jclouds.io.Payloads; @@ -151,4 +151,4 @@ public class BindAzureBlobMetadataToRequestTest extends RestClientTest createContextSpec() { return new RestContextFactory().createContextSpec("azureblob", "identity", "credential", new Properties()); } -} \ No newline at end of file +} diff --git a/azure/src/test/java/org/jclouds/azure/storage/blob/blobstore/AzureBlobRequestSignerTest.java b/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSignerTest.java similarity index 96% rename from azure/src/test/java/org/jclouds/azure/storage/blob/blobstore/AzureBlobRequestSignerTest.java rename to providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSignerTest.java index b01037edc7..91ec23e0a7 100644 --- a/azure/src/test/java/org/jclouds/azure/storage/blob/blobstore/AzureBlobRequestSignerTest.java +++ b/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSignerTest.java @@ -17,15 +17,15 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.blobstore; +package org.jclouds.azureblob.blobstore; import static org.testng.Assert.assertEquals; import java.io.IOException; import java.util.Properties; -import org.jclouds.azure.storage.blob.AzureBlobAsyncClient; -import org.jclouds.azure.storage.blob.config.AzureBlobRestClientModule; +import org.jclouds.azureblob.AzureBlobAsyncClient; +import org.jclouds.azureblob.config.AzureBlobRestClientModule; import org.jclouds.blobstore.BlobRequestSigner; import org.jclouds.blobstore.domain.Blob; import org.jclouds.blobstore.domain.Blob.Factory; @@ -143,4 +143,4 @@ public class AzureBlobRequestSignerTest extends RestClientTest contents = Sets.newTreeSet(); contents.add(new ContainerPropertiesImpl(URI .create("http://myaccount.blob.core.windows.net/audio"), dateService @@ -94,7 +94,7 @@ public class AccountNameEnumerationResultsHandlerTest extends BaseHandlerTest { .create("http://myaccount.blob.core.windows.net/textfiles"), dateService .rfc822DateParse("Wed, 15 Aug 2008 20:39:39 GMT"), "0x8CACB9BD7BACAC3", Maps . newHashMap())); - InputStream is = getClass().getResourceAsStream("/blob/test_list_containers_options.xml"); + InputStream is = getClass().getResourceAsStream("/test_list_containers_options.xml"); BoundedSet list = new BoundedHashSet(contents, URI .create("http://myaccount.blob.core.windows.net"), "prefix", "marker", 1, "video"); BoundedSet result = (BoundedSet) factory.create( diff --git a/azure/src/test/java/org/jclouds/azure/storage/blob/xml/ContainerNameEnumerationResultsHandlerTest.java b/providers/azureblob/src/test/java/org/jclouds/azureblob/xml/ContainerNameEnumerationResultsHandlerTest.java similarity index 87% rename from azure/src/test/java/org/jclouds/azure/storage/blob/xml/ContainerNameEnumerationResultsHandlerTest.java rename to providers/azureblob/src/test/java/org/jclouds/azureblob/xml/ContainerNameEnumerationResultsHandlerTest.java index aa0cef651b..95e467cb3e 100644 --- a/azure/src/test/java/org/jclouds/azure/storage/blob/xml/ContainerNameEnumerationResultsHandlerTest.java +++ b/providers/azureblob/src/test/java/org/jclouds/azureblob/xml/ContainerNameEnumerationResultsHandlerTest.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.blob.xml; +package org.jclouds.azureblob.xml; import static org.testng.Assert.assertEquals; @@ -25,12 +25,12 @@ import java.io.InputStream; import java.net.URI; import java.util.Set; -import org.jclouds.azure.storage.blob.domain.BlobProperties; -import org.jclouds.azure.storage.blob.domain.BlobType; -import org.jclouds.azure.storage.blob.domain.LeaseStatus; -import org.jclouds.azure.storage.blob.domain.ListBlobsResponse; -import org.jclouds.azure.storage.blob.domain.internal.BlobPropertiesImpl; -import org.jclouds.azure.storage.blob.domain.internal.HashSetListBlobsResponse; +import org.jclouds.azureblob.domain.BlobProperties; +import org.jclouds.azureblob.domain.BlobType; +import org.jclouds.azureblob.domain.LeaseStatus; +import org.jclouds.azureblob.domain.ListBlobsResponse; +import org.jclouds.azureblob.domain.internal.BlobPropertiesImpl; +import org.jclouds.azureblob.domain.internal.HashSetListBlobsResponse; import org.jclouds.date.DateService; import org.jclouds.http.functions.BaseHandlerTest; import org.testng.annotations.BeforeTest; @@ -58,7 +58,7 @@ public class ContainerNameEnumerationResultsHandlerTest extends BaseHandlerTest } public void testApplyInputStream() { - InputStream is = getClass().getResourceAsStream("/blob/test_list_blobs.xml"); + InputStream is = getClass().getResourceAsStream("/test_list_blobs.xml"); Set contents = Sets.newTreeSet(); contents.add(new BlobPropertiesImpl(BlobType.BLOCK_BLOB, "blob1.txt", URI .create("http://myaccount.blob.core.windows.net/mycontainer/blob1.txt"), dateService @@ -85,7 +85,7 @@ public class ContainerNameEnumerationResultsHandlerTest extends BaseHandlerTest } public void testOptions() { - InputStream is = getClass().getResourceAsStream("/blob/test_list_blobs_options.xml"); + InputStream is = getClass().getResourceAsStream("/test_list_blobs_options.xml"); Set contents = Sets.newTreeSet(); contents.add(new BlobPropertiesImpl(BlobType.BLOCK_BLOB, "a", URI .create("https://jclouds.blob.core.windows.net/adriancole-blobstore3/a"), dateService diff --git a/providers/azureblob/src/test/resources/log4j.xml b/providers/azureblob/src/test/resources/log4j.xml new file mode 100755 index 0000000000..ac0a225fbb --- /dev/null +++ b/providers/azureblob/src/test/resources/log4j.xml @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/azure/src/test/resources/blob/test_list_blobs.xml b/providers/azureblob/src/test/resources/test_list_blobs.xml similarity index 100% rename from azure/src/test/resources/blob/test_list_blobs.xml rename to providers/azureblob/src/test/resources/test_list_blobs.xml diff --git a/azure/src/test/resources/blob/test_list_blobs_options.xml b/providers/azureblob/src/test/resources/test_list_blobs_options.xml similarity index 100% rename from azure/src/test/resources/blob/test_list_blobs_options.xml rename to providers/azureblob/src/test/resources/test_list_blobs_options.xml diff --git a/azure/src/test/resources/blob/test_list_containers.xml b/providers/azureblob/src/test/resources/test_list_containers.xml similarity index 100% rename from azure/src/test/resources/blob/test_list_containers.xml rename to providers/azureblob/src/test/resources/test_list_containers.xml diff --git a/azure/src/test/resources/blob/test_list_containers_options.xml b/providers/azureblob/src/test/resources/test_list_containers_options.xml similarity index 100% rename from azure/src/test/resources/blob/test_list_containers_options.xml rename to providers/azureblob/src/test/resources/test_list_containers_options.xml diff --git a/providers/pom.xml b/providers/pom.xml index 4d695c5b7b..9a5a9b1cb5 100644 --- a/providers/pom.xml +++ b/providers/pom.xml @@ -36,6 +36,7 @@ gogrid slicehost cloudsigma + azureblob aws-elb aws-s3 aws-ec2 diff --git a/sandbox-providers/azurequeue/pom.xml b/sandbox-providers/azurequeue/pom.xml new file mode 100644 index 0000000000..27d7dd6285 --- /dev/null +++ b/sandbox-providers/azurequeue/pom.xml @@ -0,0 +1,117 @@ + + + + + 4.0.0 + + org.jclouds + jclouds-project + 1.0-SNAPSHOT + ../../project/pom.xml + + org.jclouds.provider + azurequeue + jcloud azurequeue provider + jclouds components to access Azure Queue Service + + + https://{identity}.queue.core.windows.net + 2009-09-19 + ${test.azure.identity} + ${test.azure.credential} + + + + + org.jclouds.common + azure-common + ${project.version} + jar + + + org.jclouds + jclouds-core + ${project.version} + test-jar + test + + + org.jclouds.driver + jclouds-log4j + ${project.version} + test + + + log4j + log4j + 1.2.16 + test + + + + + + live + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration + integration-test + + test + + + + + test.azurequeue.endpoint + ${test.azurequeue.endpoint} + + + test.azurequeue.apiversion + ${test.azurequeue.apiversion} + + + test.azurequeue.identity + ${test.azurequeue.identity} + + + test.azurequeue.credential + ${test.azurequeue.credential} + + + + + + + + + + + + + + diff --git a/azure/src/main/java/org/jclouds/azure/storage/queue/AzureQueueAsyncClient.java b/sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/AzureQueueAsyncClient.java similarity index 89% rename from azure/src/main/java/org/jclouds/azure/storage/queue/AzureQueueAsyncClient.java rename to sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/AzureQueueAsyncClient.java index 36061bd3c5..4ecc5f68ae 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/queue/AzureQueueAsyncClient.java +++ b/sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/AzureQueueAsyncClient.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.queue; +package org.jclouds.azurequeue; import java.util.Set; import java.util.concurrent.ExecutionException; @@ -33,13 +33,13 @@ import org.jclouds.azure.storage.domain.BoundedSet; import org.jclouds.azure.storage.filters.SharedKeyLiteAuthentication; import org.jclouds.azure.storage.options.CreateOptions; import org.jclouds.azure.storage.options.ListOptions; -import org.jclouds.azure.storage.queue.binders.BindToXmlStringPayload; -import org.jclouds.azure.storage.queue.domain.QueueMessage; -import org.jclouds.azure.storage.queue.domain.QueueMetadata; -import org.jclouds.azure.storage.queue.options.GetOptions; -import org.jclouds.azure.storage.queue.options.PutMessageOptions; -import org.jclouds.azure.storage.queue.xml.AccountNameEnumerationResultsHandler; -import org.jclouds.azure.storage.queue.xml.QueueMessagesListHandler; +import org.jclouds.azurequeue.binders.BindToXmlStringPayload; +import org.jclouds.azurequeue.domain.QueueMessage; +import org.jclouds.azurequeue.domain.QueueMetadata; +import org.jclouds.azurequeue.options.GetOptions; +import org.jclouds.azurequeue.options.PutMessageOptions; +import org.jclouds.azurequeue.xml.AccountNameEnumerationResultsHandler; +import org.jclouds.azurequeue.xml.QueueMessagesListHandler; import org.jclouds.azure.storage.reference.AzureStorageHeaders; import org.jclouds.rest.annotations.BinderParam; import org.jclouds.rest.annotations.Headers; diff --git a/azure/src/main/java/org/jclouds/azure/storage/queue/AzureQueueClient.java b/sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/AzureQueueClient.java similarity index 95% rename from azure/src/main/java/org/jclouds/azure/storage/queue/AzureQueueClient.java rename to sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/AzureQueueClient.java index 7d375a0993..99d6278f3d 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/queue/AzureQueueClient.java +++ b/sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/AzureQueueClient.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.queue; +package org.jclouds.azurequeue; import java.util.Set; import java.util.concurrent.ExecutionException; @@ -26,10 +26,10 @@ import java.util.concurrent.TimeUnit; import org.jclouds.azure.storage.domain.BoundedSet; import org.jclouds.azure.storage.options.CreateOptions; import org.jclouds.azure.storage.options.ListOptions; -import org.jclouds.azure.storage.queue.domain.QueueMessage; -import org.jclouds.azure.storage.queue.domain.QueueMetadata; -import org.jclouds.azure.storage.queue.options.GetOptions; -import org.jclouds.azure.storage.queue.options.PutMessageOptions; +import org.jclouds.azurequeue.domain.QueueMessage; +import org.jclouds.azurequeue.domain.QueueMetadata; +import org.jclouds.azurequeue.options.GetOptions; +import org.jclouds.azurequeue.options.PutMessageOptions; import org.jclouds.concurrent.Timeout; import org.jclouds.http.HttpResponseException; diff --git a/azure/src/main/java/org/jclouds/azure/storage/queue/binders/BindToXmlStringPayload.java b/sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/binders/BindToXmlStringPayload.java similarity index 96% rename from azure/src/main/java/org/jclouds/azure/storage/queue/binders/BindToXmlStringPayload.java rename to sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/binders/BindToXmlStringPayload.java index f0049b15f3..7464b5efab 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/queue/binders/BindToXmlStringPayload.java +++ b/sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/binders/BindToXmlStringPayload.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.queue.binders; +package org.jclouds.azurequeue.binders; import javax.inject.Singleton; diff --git a/azure/src/main/java/org/jclouds/azure/storage/queue/domain/QueueMessage.java b/sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/domain/QueueMessage.java similarity index 99% rename from azure/src/main/java/org/jclouds/azure/storage/queue/domain/QueueMessage.java rename to sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/domain/QueueMessage.java index 3486b84846..212c960b4c 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/queue/domain/QueueMessage.java +++ b/sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/domain/QueueMessage.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.queue.domain; +package org.jclouds.azurequeue.domain; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; diff --git a/azure/src/main/java/org/jclouds/azure/storage/queue/domain/QueueMetadata.java b/sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/domain/QueueMetadata.java old mode 100755 new mode 100644 similarity index 97% rename from azure/src/main/java/org/jclouds/azure/storage/queue/domain/QueueMetadata.java rename to sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/domain/QueueMetadata.java index 7aa5e44332..270f57fc8e --- a/azure/src/main/java/org/jclouds/azure/storage/queue/domain/QueueMetadata.java +++ b/sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/domain/QueueMetadata.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.queue.domain; +package org.jclouds.azurequeue.domain; import java.net.URI; diff --git a/azure/src/main/java/org/jclouds/azure/storage/queue/options/GetOptions.java b/sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/options/GetOptions.java similarity index 94% rename from azure/src/main/java/org/jclouds/azure/storage/queue/options/GetOptions.java rename to sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/options/GetOptions.java index 2afd8dbc87..52a7b18b78 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/queue/options/GetOptions.java +++ b/sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/options/GetOptions.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.queue.options; +package org.jclouds.azurequeue.options; import static com.google.common.base.Preconditions.checkArgument; @@ -31,8 +31,8 @@ import org.jclouds.http.options.BaseHttpRequestOptions; * GetOptions.* and invoke a static creation method followed by an instance mutator (if needed): *

* - * import static org.jclouds.azure.storage.queue.options.GetOptions.Builder.* - * import org.jclouds.azure.storage.queue.AzureQueueClient; + * import static org.jclouds.azurequeue.options.GetOptions.Builder.* + * import org.jclouds.azurequeue.AzureQueueClient; *

* AzureQueueClient connection = // get connection * messages = connection.getMessages("queueName", maxMessages(3)); diff --git a/azure/src/main/java/org/jclouds/azure/storage/queue/options/PutMessageOptions.java b/sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/options/PutMessageOptions.java similarity index 91% rename from azure/src/main/java/org/jclouds/azure/storage/queue/options/PutMessageOptions.java rename to sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/options/PutMessageOptions.java index 236554e567..3f82c668a5 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/queue/options/PutMessageOptions.java +++ b/sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/options/PutMessageOptions.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.queue.options; +package org.jclouds.azurequeue.options; import org.jclouds.http.options.BaseHttpRequestOptions; @@ -28,8 +28,8 @@ import org.jclouds.http.options.BaseHttpRequestOptions; * mutator (if needed): *

* - * import static org.jclouds.azure.storage.queue.options.PutMessageOptions.Builder.* - * import org.jclouds.azure.storage.queue.AzureQueueClient; + * import static org.jclouds.azurequeue.options.PutMessageOptions.Builder.* + * import org.jclouds.azurequeue.AzureQueueClient; *

* AzureQueueClient connection = // get connection * connection.putMessage("containerName", withTTL()); diff --git a/azure/src/main/java/org/jclouds/azure/storage/queue/xml/AccountNameEnumerationResultsHandler.java b/sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/xml/AccountNameEnumerationResultsHandler.java old mode 100755 new mode 100644 similarity index 96% rename from azure/src/main/java/org/jclouds/azure/storage/queue/xml/AccountNameEnumerationResultsHandler.java rename to sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/xml/AccountNameEnumerationResultsHandler.java index 0db60da3c6..d542bbf61a --- a/azure/src/main/java/org/jclouds/azure/storage/queue/xml/AccountNameEnumerationResultsHandler.java +++ b/sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/xml/AccountNameEnumerationResultsHandler.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.queue.xml; +package org.jclouds.azurequeue.xml; import java.net.URI; import java.util.Set; @@ -26,7 +26,7 @@ import javax.inject.Inject; import org.jclouds.azure.storage.domain.BoundedSet; import org.jclouds.azure.storage.domain.internal.BoundedHashSet; -import org.jclouds.azure.storage.queue.domain.QueueMetadata; +import org.jclouds.azurequeue.domain.QueueMetadata; import org.jclouds.http.functions.ParseSax; import com.google.common.collect.Sets; diff --git a/azure/src/main/java/org/jclouds/azure/storage/queue/xml/QueueMessagesListHandler.java b/sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/xml/QueueMessagesListHandler.java similarity index 97% rename from azure/src/main/java/org/jclouds/azure/storage/queue/xml/QueueMessagesListHandler.java rename to sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/xml/QueueMessagesListHandler.java index 5bd6190f6b..d4406d43c2 100644 --- a/azure/src/main/java/org/jclouds/azure/storage/queue/xml/QueueMessagesListHandler.java +++ b/sandbox-providers/azurequeue/src/main/java/org/jclouds/azurequeue/xml/QueueMessagesListHandler.java @@ -17,14 +17,14 @@ * ==================================================================== */ -package org.jclouds.azure.storage.queue.xml; +package org.jclouds.azurequeue.xml; import java.util.Date; import java.util.Set; import javax.inject.Inject; -import org.jclouds.azure.storage.queue.domain.QueueMessage; +import org.jclouds.azurequeue.domain.QueueMessage; import org.jclouds.date.DateService; import org.jclouds.http.functions.ParseSax; diff --git a/azure/src/test/java/org/jclouds/azure/storage/queue/AzureQueueAsyncClientTest.java b/sandbox-providers/azurequeue/src/test/java/org/jclouds/azurequeue/AzureQueueAsyncClientTest.java similarity index 95% rename from azure/src/test/java/org/jclouds/azure/storage/queue/AzureQueueAsyncClientTest.java rename to sandbox-providers/azurequeue/src/test/java/org/jclouds/azurequeue/AzureQueueAsyncClientTest.java index dcd8b907a8..662325c0ef 100644 --- a/azure/src/test/java/org/jclouds/azure/storage/queue/AzureQueueAsyncClientTest.java +++ b/sandbox-providers/azurequeue/src/test/java/org/jclouds/azurequeue/AzureQueueAsyncClientTest.java @@ -17,12 +17,12 @@ * ==================================================================== */ -package org.jclouds.azure.storage.queue; +package org.jclouds.azurequeue; import static org.jclouds.azure.storage.options.CreateOptions.Builder.withMetadata; import static org.jclouds.azure.storage.options.ListOptions.Builder.maxResults; -import static org.jclouds.azure.storage.queue.options.GetOptions.Builder.maxMessages; -import static org.jclouds.azure.storage.queue.options.PutMessageOptions.Builder.withTTL; +import static org.jclouds.azurequeue.options.GetOptions.Builder.maxMessages; +import static org.jclouds.azurequeue.options.PutMessageOptions.Builder.withTTL; import static org.testng.Assert.assertEquals; import java.io.IOException; @@ -32,10 +32,10 @@ import java.util.Properties; import org.jclouds.azure.storage.filters.SharedKeyLiteAuthentication; import org.jclouds.azure.storage.options.CreateOptions; import org.jclouds.azure.storage.options.ListOptions; -import org.jclouds.azure.storage.queue.options.GetOptions; -import org.jclouds.azure.storage.queue.options.PutMessageOptions; -import org.jclouds.azure.storage.queue.xml.AccountNameEnumerationResultsHandler; -import org.jclouds.azure.storage.queue.xml.QueueMessagesListHandler; +import org.jclouds.azurequeue.options.GetOptions; +import org.jclouds.azurequeue.options.PutMessageOptions; +import org.jclouds.azurequeue.xml.AccountNameEnumerationResultsHandler; +import org.jclouds.azurequeue.xml.QueueMessagesListHandler; import org.jclouds.http.HttpRequest; import org.jclouds.http.functions.ParseSax; import org.jclouds.http.functions.ReleasePayloadAndReturn; diff --git a/azure/src/test/java/org/jclouds/azure/storage/queue/AzureQueueClientLiveTest.java b/sandbox-providers/azurequeue/src/test/java/org/jclouds/azurequeue/AzureQueueClientLiveTest.java similarity index 94% rename from azure/src/test/java/org/jclouds/azure/storage/queue/AzureQueueClientLiveTest.java rename to sandbox-providers/azurequeue/src/test/java/org/jclouds/azurequeue/AzureQueueClientLiveTest.java index 08b039a19f..1f6ffd53fe 100644 --- a/azure/src/test/java/org/jclouds/azure/storage/queue/AzureQueueClientLiveTest.java +++ b/sandbox-providers/azurequeue/src/test/java/org/jclouds/azurequeue/AzureQueueClientLiveTest.java @@ -17,12 +17,12 @@ * ==================================================================== */ -package org.jclouds.azure.storage.queue; +package org.jclouds.azurequeue; import static com.google.common.base.Preconditions.checkNotNull; import static org.jclouds.azure.storage.options.ListOptions.Builder.prefix; -import static org.jclouds.azure.storage.queue.options.GetOptions.Builder.maxMessages; -import static org.jclouds.azure.storage.queue.options.PutMessageOptions.Builder.withTTL; +import static org.jclouds.azurequeue.options.GetOptions.Builder.maxMessages; +import static org.jclouds.azurequeue.options.PutMessageOptions.Builder.withTTL; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; @@ -33,8 +33,8 @@ import java.util.Set; import org.jclouds.Constants; import org.jclouds.azure.storage.domain.BoundedSet; import org.jclouds.azure.storage.options.CreateOptions; -import org.jclouds.azure.storage.queue.domain.QueueMessage; -import org.jclouds.azure.storage.queue.domain.QueueMetadata; +import org.jclouds.azurequeue.domain.QueueMessage; +import org.jclouds.azurequeue.domain.QueueMetadata; import org.jclouds.http.HttpResponseException; import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.rest.RestContextFactory; diff --git a/azure/src/test/java/org/jclouds/azure/storage/queue/options/GetOptionsTest.java b/sandbox-providers/azurequeue/src/test/java/org/jclouds/azurequeue/options/GetOptionsTest.java similarity index 98% rename from azure/src/test/java/org/jclouds/azure/storage/queue/options/GetOptionsTest.java rename to sandbox-providers/azurequeue/src/test/java/org/jclouds/azurequeue/options/GetOptionsTest.java index e27268be3b..922ef70a15 100644 --- a/azure/src/test/java/org/jclouds/azure/storage/queue/options/GetOptionsTest.java +++ b/sandbox-providers/azurequeue/src/test/java/org/jclouds/azurequeue/options/GetOptionsTest.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.queue.options; +package org.jclouds.azurequeue.options; import static org.testng.Assert.assertEquals; diff --git a/azure/src/test/java/org/jclouds/azure/storage/queue/xml/AccountNameEnumerationResultsHandlerTest.java b/sandbox-providers/azurequeue/src/test/java/org/jclouds/azurequeue/xml/AccountNameEnumerationResultsHandlerTest.java similarity index 90% rename from azure/src/test/java/org/jclouds/azure/storage/queue/xml/AccountNameEnumerationResultsHandlerTest.java rename to sandbox-providers/azurequeue/src/test/java/org/jclouds/azurequeue/xml/AccountNameEnumerationResultsHandlerTest.java index a6b90f2132..c40aef4eef 100644 --- a/azure/src/test/java/org/jclouds/azure/storage/queue/xml/AccountNameEnumerationResultsHandlerTest.java +++ b/sandbox-providers/azurequeue/src/test/java/org/jclouds/azurequeue/xml/AccountNameEnumerationResultsHandlerTest.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.azure.storage.queue.xml; +package org.jclouds.azurequeue.xml; import static org.testng.Assert.assertEquals; @@ -26,7 +26,7 @@ import java.net.URI; import org.jclouds.azure.storage.domain.BoundedSet; import org.jclouds.azure.storage.domain.internal.BoundedHashSet; -import org.jclouds.azure.storage.queue.domain.QueueMetadata; +import org.jclouds.azurequeue.domain.QueueMetadata; import org.jclouds.http.functions.BaseHandlerTest; import org.testng.annotations.Test; @@ -42,7 +42,7 @@ import com.google.common.collect.ImmutableSortedSet; public class AccountNameEnumerationResultsHandlerTest extends BaseHandlerTest { public void testApplyInputStream() { - InputStream is = getClass().getResourceAsStream("/queue/test_list_queues.xml"); + InputStream is = getClass().getResourceAsStream("/test_list_queues.xml"); BoundedSet list = new BoundedHashSet(ImmutableSortedSet.of( new QueueMetadata("q1", URI.create("http://myaccount.queue.core.windows.net/q1")), new QueueMetadata("q2", URI.create("http://myaccount.queue.core.windows.net/q2")), @@ -54,7 +54,7 @@ public class AccountNameEnumerationResultsHandlerTest extends BaseHandlerTest { } public void testApplyInputStreamWithOptions() { - InputStream is = getClass().getResourceAsStream("/queue/test_list_queues_options.xml"); + InputStream is = getClass().getResourceAsStream("/test_list_queues_options.xml"); BoundedSet list = new BoundedHashSet(ImmutableSortedSet.of( new QueueMetadata("q4", URI.create("http://myaccount.queue.core.windows.net/q4")), new QueueMetadata("q5", URI.create("http://myaccount.queue.core.windows.net/q5"))), diff --git a/azure/src/test/java/org/jclouds/azure/storage/queue/xml/QueueMessagesListHandlerTest.java b/sandbox-providers/azurequeue/src/test/java/org/jclouds/azurequeue/xml/QueueMessagesListHandlerTest.java similarity index 93% rename from azure/src/test/java/org/jclouds/azure/storage/queue/xml/QueueMessagesListHandlerTest.java rename to sandbox-providers/azurequeue/src/test/java/org/jclouds/azurequeue/xml/QueueMessagesListHandlerTest.java index 9f7647427e..83172205cd 100644 --- a/azure/src/test/java/org/jclouds/azure/storage/queue/xml/QueueMessagesListHandlerTest.java +++ b/sandbox-providers/azurequeue/src/test/java/org/jclouds/azurequeue/xml/QueueMessagesListHandlerTest.java @@ -17,14 +17,14 @@ * ==================================================================== */ -package org.jclouds.azure.storage.queue.xml; +package org.jclouds.azurequeue.xml; import static org.testng.Assert.assertEquals; import java.io.InputStream; import java.util.Set; -import org.jclouds.azure.storage.queue.domain.QueueMessage; +import org.jclouds.azurequeue.domain.QueueMessage; import org.jclouds.date.DateService; import org.jclouds.http.functions.BaseHandlerTest; import org.testng.annotations.BeforeTest; @@ -49,7 +49,7 @@ public class QueueMessagesListHandlerTest extends BaseHandlerTest { } public void testApplyInputStream() { - InputStream is = getClass().getResourceAsStream("/queue/test_get_messages.xml"); + InputStream is = getClass().getResourceAsStream("/test_get_messages.xml"); Set expected = ImmutableSet. of( new QueueMessage("43190737-06f4-4ccf-b600-28f410707df3", dateService diff --git a/sandbox-providers/azurequeue/src/test/resources/log4j.xml b/sandbox-providers/azurequeue/src/test/resources/log4j.xml new file mode 100755 index 0000000000..97bc3dc772 --- /dev/null +++ b/sandbox-providers/azurequeue/src/test/resources/log4j.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/azure/src/test/resources/queue/test_get_messages.xml b/sandbox-providers/azurequeue/src/test/resources/test_get_messages.xml similarity index 100% rename from azure/src/test/resources/queue/test_get_messages.xml rename to sandbox-providers/azurequeue/src/test/resources/test_get_messages.xml diff --git a/azure/src/test/resources/queue/test_list_queues.xml b/sandbox-providers/azurequeue/src/test/resources/test_list_queues.xml similarity index 100% rename from azure/src/test/resources/queue/test_list_queues.xml rename to sandbox-providers/azurequeue/src/test/resources/test_list_queues.xml diff --git a/azure/src/test/resources/queue/test_list_queues_options.xml b/sandbox-providers/azurequeue/src/test/resources/test_list_queues_options.xml similarity index 100% rename from azure/src/test/resources/queue/test_list_queues_options.xml rename to sandbox-providers/azurequeue/src/test/resources/test_list_queues_options.xml