Issue 440: created org.jclouds.common/azure-common, org.jclouds.provider/azureblob, azurequeue

This commit is contained in:
Adrian Cole 2011-01-16 17:06:34 -08:00
parent 99b409de66
commit bf1ee9487b
124 changed files with 928 additions and 560 deletions

View File

@ -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)
@ -51,7 +51,7 @@ our blobstore api supports: aws-s3, cloudfiles (generic), cloudfiles-us, cloudfi
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
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

View File

@ -70,8 +70,8 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jclouds-azure</artifactId>
<groupId>org.jclouds.provider</groupId>
<artifactId>azureblob</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>

View File

@ -1,50 +0,0 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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<String> providers = Providers.getSupportedProviders();
assert Iterables.contains(providers, "azurequeue") : providers;
assert Iterables.contains(providers, "azureblob") : providers;
}
@Test
public void testSupportedBlobStoreProviders() {
Iterable<String> providers = BlobStoreUtils.getSupportedProviders();
assert !Iterables.contains(providers, "azurequeue") : providers;
assert Iterables.contains(providers, "azureblob") : providers;
}
}

View File

@ -1,96 +0,0 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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.<Module> of(new Log4JLoggingModule())).buildInjector();
}
@SuppressWarnings("unchecked")
@Test
void testUpdatesOnlyOncePerSecond() throws NoSuchMethodException, InterruptedException {
@SuppressWarnings("rawtypes")
AzureStorageRestClientModule module = new AzureBlobRestClientModule();
Supplier<String> 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);
}
}

50
common/azure/pom.xml Normal file
View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
====================================================================
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.
====================================================================
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-project</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../../project/pom.xml</relativePath>
</parent>
<groupId>org.jclouds.common</groupId>
<artifactId>azure-common</artifactId>
<name>jclouds Azure Components Core</name>
<description>jclouds Core components to access Azure</description>
<dependencies>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -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());

View File

@ -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;
}
}

View File

@ -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.<Module> of(new Log4JLoggingModule())).buildInjector();
injector = RestContextFactory.createContextBuilder(DUMMY_SPEC).buildInjector();
filter = injector.getInstance(SharedKeyLiteAuthentication.class);
}
@SuppressWarnings("unchecked")
public static final RestContextSpec<Map, List> DUMMY_SPEC = new RestContextSpec<Map, List>("provider", "endpoint",
"apiVersion", "identity", "credential", Map.class, List.class, PropertiesBuilder.class,
(Class) RestContextBuilder.class, ImmutableList.<Module> of(new MockModule(), new NullLoggingModule(),
new AzureStorageRestClientModule<Exception, RuntimeException>(Exception.class, RuntimeException.class)));
}

View File

@ -33,6 +33,7 @@
<packaging>pom</packaging>
<name>jclouds commons project</name>
<modules>
<module>azure</module>
<module>aws</module>
<module>openstack</module>
<module>vcloud</module>

View File

@ -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

View File

@ -45,7 +45,6 @@
<module>drivers</module>
<module>tools</module>
<module>scriptbuilder</module>
<module>azure</module>
<module>allcompute</module>
<module>allblobstore</module>
<module>all</module>

View File

@ -20,64 +20,53 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4.0.0.xsd" >
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-project</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../project/pom.xml</relativePath>
<relativePath>../../project/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-azure</artifactId>
<name>jclouds azure services core</name>
<description>jclouds core components to access azure services</description>
<groupId>org.jclouds.provider</groupId>
<artifactId>azureblob</artifactId>
<name>jcloud azureblob provider</name>
<description>jclouds components to access Azure Blob Service</description>
<properties>
<test.azure.endpoint>https://auth.api.azurecloud.com</test.azure.endpoint>
<test.azure.apiversion>2009-09-19</test.azure.apiversion>
<test.azure.identity>FIXME</test.azure.identity>
<test.azure.credential>FIXME</test.azure.credential>
<test.initializer>org.jclouds.azure.storage.blob.blobstore.integration.AzureBlobTestInitializer</test.initializer>
<test.azureblob.endpoint>https://${test.azure.identity}.blob.core.windows.net</test.azureblob.endpoint>
<test.azureblob.apiversion>${test.azure.apiversion}</test.azureblob.apiversion>
<test.initializer>org.jclouds.azureblob.blobstore.integration.AzureBlobTestInitializer</test.initializer>
<test.azureblob.endpoint>https://{identity}.blob.core.windows.net</test.azureblob.endpoint>
<test.azureblob.apiversion>2009-09-19</test.azureblob.apiversion>
<test.azureblob.identity>${test.azure.identity}</test.azureblob.identity>
<test.azureblob.credential>${test.azure.credential}</test.azureblob.credential>
<test.azurequeue.endpoint>https://${test.azure.identity}.queue.core.windows.net</test.azurequeue.endpoint>
<test.azurequeue.apiversion>${test.azure.apiversion}</test.azurequeue.apiversion>
<test.azurequeue.identity>${test.azure.identity}</test.azurequeue.identity>
<test.azurequeue.credential>${test.azure.credential}</test.azurequeue.credential>
</properties>
<scm>
<connection>scm:svn:http://jclouds.googlecode.com/svn/trunk/azure</connection>
<developerConnection>scm:svn:https://jclouds.googlecode.com/svn/trunk/azure</developerConnection>
<url>http://jclouds.googlecode.com/svn/trunk/azure</url>
</scm>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jclouds-blobstore</artifactId>
<groupId>org.jclouds.common</groupId>
<artifactId>azure-common</artifactId>
<version>${project.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-blobstore</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-blobstore</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
@ -86,8 +75,15 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profiles>
<profile>
<id>live</id>
<build>
@ -120,22 +116,6 @@
<name>test.azureblob.credential</name>
<value>${test.azureblob.credential}</value>
</property>
<property>
<name>test.azurequeue.endpoint</name>
<value>${test.azurequeue.endpoint}</value>
</property>
<property>
<name>test.azurequeue.apiversion</name>
<value>${test.azurequeue.apiversion}</value>
</property>
<property>
<name>test.azurequeue.identity</name>
<value>${test.azurequeue.identity}</value>
</property>
<property>
<name>test.azurequeue.credential</name>
<value>${test.azurequeue.credential}</value>
</property>
<property>
<name>test.initializer</name>
<value>${test.initializer}</value>
@ -158,4 +138,6 @@
</profile>
</profiles>
</project>

View File

@ -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<String> 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<org.jclouds.azure.storage.blob.domain.AzureBlob> getBlob(
ListenableFuture<org.jclouds.azureblob.domain.AzureBlob> getBlob(
@PathParam("container") @ParamValidators( { ContainerNameValidator.class }) String container,
@PathParam("name") String name, GetOptions... options);

View File

@ -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);
/**

View File

@ -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;

View File

@ -0,0 +1,49 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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);
}
}

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob;
package org.jclouds.azureblob;
import java.net.URI;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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.BlobProperties;
import org.jclouds.azureblob.domain.BlobProperties;
import org.jclouds.blobstore.domain.MutableBlobMetadata;
import org.jclouds.blobstore.domain.StorageType;
import org.jclouds.blobstore.domain.internal.MutableBlobMetadataImpl;

View File

@ -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 com.google.common.base.Function;

View File

@ -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;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.blobstore.functions;
package org.jclouds.azureblob.blobstore.functions;
import java.util.Map;
import java.util.Set;
@ -25,7 +25,7 @@ import java.util.Set;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.jclouds.azure.storage.blob.domain.ListBlobsResponse;
import org.jclouds.azureblob.domain.ListBlobsResponse;
import org.jclouds.blobstore.domain.PageSet;
import org.jclouds.blobstore.domain.StorageMetadata;
import org.jclouds.blobstore.domain.StorageType;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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<AzureBlobClient, AzureBlobAsyncClient> {
public class AzureBlobRestClientModule extends AzureStorageRestClientModule<AzureBlobClient, AzureBlobAsyncClient> {
public AzureBlobRestClientModule() {
super(AzureBlobClient.class, AzureBlobAsyncClient.class);
@ -45,4 +49,11 @@ public class AzureBlobRestClientModule extends
super.configure();
}
@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);
}
}

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.domain;
package org.jclouds.azureblob.domain;
import javax.annotation.Nullable;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.domain;
package org.jclouds.azureblob.domain;
import java.net.URI;
import java.util.Date;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.domain;
package org.jclouds.azureblob.domain;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.domain;
package org.jclouds.azureblob.domain;
import java.net.URI;
import java.util.Date;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.domain;
package org.jclouds.azureblob.domain;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.domain;
package org.jclouds.azureblob.domain;
import java.util.Set;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -17,12 +17,12 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.functions;
package org.jclouds.azureblob.functions;
import javax.inject.Inject;
import org.jclouds.azure.storage.blob.blobstore.functions.BlobMetadataToBlobProperties;
import org.jclouds.azure.storage.blob.domain.MutableBlobProperties;
import org.jclouds.azureblob.blobstore.functions.BlobMetadataToBlobProperties;
import org.jclouds.azureblob.domain.MutableBlobProperties;
import org.jclouds.blobstore.domain.BlobMetadata;
import org.jclouds.blobstore.functions.ParseSystemAndUserMetadataFromHeaders;
import org.jclouds.http.HttpRequest;
@ -32,7 +32,7 @@ import org.jclouds.rest.InvocationContext;
import com.google.common.base.Function;
/**
* This parses @{link {@link org.jclouds.azure.storage.blob.domain.BlobProperties} from HTTP
* This parses @{link {@link org.jclouds.azureblob.domain.BlobProperties} from HTTP
* headers.
*
*

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.functions;
package org.jclouds.azureblob.functions;
import static com.google.common.base.Preconditions.checkArgument;
@ -27,9 +27,9 @@ import javax.inject.Inject;
import javax.inject.Named;
import javax.ws.rs.core.HttpHeaders;
import org.jclouds.azure.storage.blob.domain.ContainerProperties;
import org.jclouds.azure.storage.blob.domain.MutableContainerPropertiesWithMetadata;
import org.jclouds.azure.storage.blob.domain.internal.MutableContainerPropertiesWithMetadataImpl;
import org.jclouds.azureblob.domain.ContainerProperties;
import org.jclouds.azureblob.domain.MutableContainerPropertiesWithMetadata;
import org.jclouds.azureblob.domain.internal.MutableContainerPropertiesWithMetadataImpl;
import org.jclouds.blobstore.reference.BlobStoreConstants;
import org.jclouds.date.DateService;
import org.jclouds.http.HttpException;
@ -42,7 +42,7 @@ import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Function;
/**
* This parses @{link {@link org.jclouds.azure.storage.blob.domain.ListableContainerProperties} from
* This parses @{link {@link org.jclouds.azureblob.domain.ListableContainerProperties} from
* HTTP headers.
*
*

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.functions;
package org.jclouds.azureblob.functions;
import static org.jclouds.util.Throwables2.propagateOrNull;

View File

@ -0,0 +1,64 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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);
}
}
}

View File

@ -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):
* <p/>
* <code>
* 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;
* <p/>
* AzureBlobClient connection = // get connection
* boolean createdWithPublicAcl = connection.createContainer("containerName", withPublicAcl());

View File

@ -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):
* <p/>
* <code>
* 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;
* <p/>
* AzureBlobClient connection = // get connection
* Set<BlobMetadata> blobs = connection.listBlobs("containerName", delimiter("/"));

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.predicates.validators;
package org.jclouds.azureblob.predicates.validators;
import javax.inject.Inject;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -17,11 +17,11 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.blobstore.config;
package org.jclouds.azureblob.blobstore.config;
import static org.testng.Assert.assertEquals;
import org.jclouds.azure.storage.blob.blobstore.strategy.FindMD5InBlobProperties;
import org.jclouds.azureblob.blobstore.strategy.FindMD5InBlobProperties;
import org.jclouds.blobstore.BlobStoreContext;
import org.jclouds.blobstore.internal.BlobStoreContextImpl;
import org.jclouds.blobstore.strategy.ContainsValueInListStrategy;

View File

@ -17,11 +17,11 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.blobstore.functions;
package org.jclouds.azureblob.blobstore.functions;
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;

View File

@ -17,17 +17,17 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.blobstore.functions;
package org.jclouds.azureblob.blobstore.functions;
import java.util.SortedSet;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.jclouds.azure.storage.blob.domain.BlobProperties;
import org.jclouds.azure.storage.blob.domain.ListBlobsResponse;
import org.jclouds.azure.storage.blob.domain.MutableBlobProperties;
import org.jclouds.azure.storage.blob.domain.internal.HashSetListBlobsResponse;
import org.jclouds.azureblob.domain.BlobProperties;
import org.jclouds.azureblob.domain.ListBlobsResponse;
import org.jclouds.azureblob.domain.MutableBlobProperties;
import org.jclouds.azureblob.domain.internal.HashSetListBlobsResponse;
import org.jclouds.blobstore.domain.BlobMetadata;
import org.jclouds.blobstore.domain.PageSet;
import org.jclouds.blobstore.domain.StorageMetadata;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.blobstore.integration;
package org.jclouds.azureblob.blobstore.integration;
import org.jclouds.blobstore.integration.internal.BaseContainerIntegrationTest;
import org.testng.annotations.Test;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.blobstore.integration;
package org.jclouds.azureblob.blobstore.integration;
import org.jclouds.blobstore.integration.internal.BaseContainerLiveTest;
import org.testng.annotations.Test;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.blobstore.integration;
package org.jclouds.azureblob.blobstore.integration;
import org.jclouds.blobstore.integration.internal.BaseInputStreamMapIntegrationTest;
import org.testng.annotations.Test;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.blobstore.integration;
package org.jclouds.azureblob.blobstore.integration;
import java.io.IOException;
import java.io.UnsupportedEncodingException;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.blobstore.integration;
package org.jclouds.azureblob.blobstore.integration;
import org.jclouds.blobstore.integration.internal.BaseBlobLiveTest;
import org.testng.annotations.Test;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.blobstore.integration;
package org.jclouds.azureblob.blobstore.integration;
import org.jclouds.blobstore.integration.internal.BaseBlobMapIntegrationTest;
import org.testng.annotations.Test;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.blobstore.integration;
package org.jclouds.azureblob.blobstore.integration;
import org.jclouds.blobstore.integration.internal.BaseServiceIntegrationTest;
import org.testng.annotations.Test;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.blobstore.integration;
package org.jclouds.azureblob.blobstore.integration;
import org.jclouds.blobstore.integration.internal.BaseBlobSignerLiveTest;
import org.testng.annotations.Test;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.blobstore.integration;
package org.jclouds.azureblob.blobstore.integration;
import java.io.IOException;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.options;
package org.jclouds.azureblob.options;
import static org.testng.Assert.assertEquals;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.options;
package org.jclouds.azureblob.options;
import static org.testng.Assert.assertEquals;

View File

@ -17,10 +17,10 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.predicates.validators;
package org.jclouds.azureblob.predicates.validators;
import org.testng.annotations.Test;
import org.jclouds.azure.storage.blob.predicates.validators.ContainerNameValidator;
import org.jclouds.azureblob.predicates.validators.ContainerNameValidator;
public class ContainerNameValidatorTest {

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.azure.storage.blob.xml;
package org.jclouds.azureblob.xml;
import static org.testng.Assert.assertEquals;
@ -25,8 +25,8 @@ import java.io.InputStream;
import java.net.URI;
import java.util.SortedSet;
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;
@ -57,7 +57,7 @@ public class AccountNameEnumerationResultsHandlerTest extends BaseHandlerTest {
}
public void testApplyInputStream() {
InputStream is = getClass().getResourceAsStream("/blob/test_list_containers.xml");
InputStream is = getClass().getResourceAsStream("/test_list_containers.xml");
SortedSet<ContainerProperties> 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
.<String, String> newHashMap()));
InputStream is = getClass().getResourceAsStream("/blob/test_list_containers_options.xml");
InputStream is = getClass().getResourceAsStream("/test_list_containers_options.xml");
BoundedSet<ContainerProperties> list = new BoundedHashSet<ContainerProperties>(contents, URI
.create("http://myaccount.blob.core.windows.net"), "prefix", "marker", 1, "video");
BoundedSet<ContainerProperties> result = (BoundedSet<ContainerProperties>) factory.create(

View File

@ -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<BlobProperties> 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<BlobProperties> contents = Sets.newTreeSet();
contents.add(new BlobPropertiesImpl(BlobType.BLOCK_BLOB, "a", URI
.create("https://jclouds.blob.core.windows.net/adriancole-blobstore3/a"), dateService

View File

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2009 Cloud Conscious, LLC.
<info@cloudconscious.com>
====================================================================
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.
====================================================================
-->
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<!--
For more configuration infromation and examples see the Apache
Log4j website: http://logging.apache.org/log4j/
-->
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="false">
<!-- A time/date based rolling appender -->
<appender name="WIREFILE" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="target/test-data/jclouds-wire.log" />
<param name="Append" value="true" />
<!-- Rollover at midnight each day -->
<param name="DatePattern" value="'.'yyyy-MM-dd" />
<param name="Threshold" value="TRACE" />
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
<!--
The full pattern: Date MS Priority [Category]
(Thread:NDC) Message\n <param name="ConversionPattern"
value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
-->
</layout>
</appender>
<!-- A time/date based rolling appender -->
<appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="target/test-data/jclouds.log" />
<param name="Append" value="true" />
<!-- Rollover at midnight each day -->
<param name="DatePattern" value="'.'yyyy-MM-dd" />
<param name="Threshold" value="TRACE" />
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
<!--
The full pattern: Date MS Priority [Category]
(Thread:NDC) Message\n <param name="ConversionPattern"
value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
-->
</layout>
</appender>
<appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
<appender-ref ref="FILE" />
</appender>
<appender name="ASYNCWIRE" class="org.apache.log4j.AsyncAppender">
<appender-ref ref="WIREFILE" />
</appender>
<!-- A time/date based rolling appender -->
<appender name="BLOBSTOREFILE" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="target/test-data/jclouds-blobstore.log" />
<param name="Append" value="true" />
<!-- Rollover at midnight each day -->
<param name="DatePattern" value="'.'yyyy-MM-dd" />
<param name="Threshold" value="TRACE" />
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
<!--
The full pattern: Date MS Priority [Category]
(Thread:NDC) Message\n <param name="ConversionPattern"
value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
-->
</layout>
</appender>
<appender name="ASYNCBLOBSTORE" class="org.apache.log4j.AsyncAppender">
<appender-ref ref="BLOBSTOREFILE" />
</appender>
<!-- ================ -->
<!-- Limit categories -->
<!-- ================ -->
<category name="jclouds.blobstore">
<priority value="TRACE" />
<appender-ref ref="ASYNCBLOBSTORE" />
</category>
<category name="org.jclouds">
<priority value="DEBUG" />
<appender-ref ref="ASYNC" />
</category>
<category name="jclouds.headers">
<priority value="DEBUG" />
<appender-ref ref="ASYNCWIRE" />
</category>
<category name="jclouds.wire">
<priority value="DEBUG" />
<appender-ref ref="ASYNCWIRE" />
</category>
<!-- ======================= -->
<!-- Setup the Root category -->
<!-- ======================= -->
<root>
<priority value="WARN" />
</root>
</log4j:configuration>

Some files were not shown because too many files have changed in this diff Show More