Issue 128: added atmos to vfs

git-svn-id: http://jclouds.googlecode.com/svn/trunk@2427 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
adrian.f.cole 2009-12-15 01:05:58 +00:00
parent 6e74a573df
commit 96c9758da8
10 changed files with 34 additions and 11 deletions

View File

@ -26,13 +26,13 @@ package org.jclouds.atmosonline.saas.config;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import org.bouncycastle.util.encoders.Base64;
import org.jclouds.atmosonline.saas.handlers.AtmosStorageClientErrorRetryHandler;
import org.jclouds.atmosonline.saas.handlers.ParseAtmosStorageErrorFromXmlContent;
import org.jclouds.atmosonline.saas.reference.AtmosStorageConstants;
import org.jclouds.concurrent.WithinThreadExecutorService;
import org.jclouds.concurrent.config.ExecutorServiceModule;
import org.jclouds.date.internal.SimpleDateFormatDateService;
import org.jclouds.encryption.internal.Base64;
import org.jclouds.http.functions.config.ParserModule;
import org.jclouds.http.handlers.DelegatingErrorHandler;
import org.jclouds.http.handlers.DelegatingRetryHandler;
@ -62,7 +62,7 @@ public class AtmosStorageRestClientModuleTest {
bindConstant().annotatedWith(Jsr330.named(AtmosStorageConstants.PROPERTY_EMCSAAS_UID))
.to("uid");
bindConstant().annotatedWith(Jsr330.named(AtmosStorageConstants.PROPERTY_EMCSAAS_KEY))
.to(new String(Base64.encode("key".getBytes())));
.to(new String(Base64.encodeBytes("key".getBytes())));
bindConstant().annotatedWith(
Jsr330.named(AtmosStorageConstants.PROPERTY_EMCSAAS_SESSIONINTERVAL)).to("2");
}

View File

@ -215,7 +215,7 @@ public class StubAtmosStorageAsyncClient implements AtmosStorageAsyncClient {
String container = path.substring(0, path.indexOf('/'));
String blobName = path.substring(path.indexOf('/') + 1);
try {
blobStore.blobMetadata(container, blobName);
blobStore.blobMetadata(container, blobName).get();
return true;
} catch (KeyNotFoundException e) {
return false;

View File

@ -170,7 +170,7 @@ public class HttpUtils {
String account = matcher.group(2);
String key = matcher.group(3);
return URI
.create(String.format("%s://%s:%s@%s", scheme, account, urlEncode(key), rest));
.create(String.format("%s://%s:%s@%s", scheme, urlEncode(account), urlEncode(key), rest));
} else {
throw new IllegalArgumentException("bad syntax");
}

View File

@ -40,7 +40,13 @@ public class CredentialsTest {
.create("blobstore://account:Base64==@azureblob/container-hyphen/prefix"));
assertEquals(creds.account, "account");
assertEquals(creds.key, "Base64==");
}
public void testAtmos() {
Credentials creds = Credentials.parse(URI
.create("blobstore://domain%2Fuser:Base64%3D%3D@azureblob/container-hyphen/prefix"));
assertEquals(creds.account, "domain/user");
assertEquals(creds.key, "Base64==");
}
public void testCloudFiles() {

View File

@ -50,6 +50,13 @@ public class HttpUtilsTest extends PerformanceTest {
assertEquals(HttpUtils.urlEncode("/read-tests/ tep", '/'), "/read-tests/%20tep");
}
public void testAtmos() {
URI creds = HttpUtils
.createUri("blobstore://domain/user:Base64==@azureblob/container-hyphen/prefix");
assertEquals(creds, URI
.create("blobstore://domain%2Fuser:Base64%3D%3D@azureblob/container-hyphen/prefix"));
}
public void testAzure() {
URI creds = HttpUtils
.createUri("blobstore://account:Base64==@azureblob/container-hyphen/prefix");

View File

@ -46,6 +46,7 @@
<module>scriptbuilder</module>
<module>aws</module>
<module>azure</module>
<module>atmos</module>
<module>mezeo</module>
<module>nirvanix</module>
<module>rackspace</module>

View File

@ -57,6 +57,11 @@
<artifactId>jclouds-aws</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jclouds-atmos</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jclouds-azure</artifactId>

View File

@ -21,6 +21,8 @@
# under the License.
# ====================================================================
#
atmos.contextbuilder=org.jclouds.atmosonline.saas.blobstore.AtmosBlobStoreContextBuilder
atmos.propertiesbuilder=org.jclouds.atmosonline.saas.AtmosStoragePropertiesBuilder
azureblob.contextbuilder=org.jclouds.azure.storage.blob.blobstore.AzureBlobStoreContextBuilder
azureblob.propertiesbuilder=org.jclouds.azure.storage.blob.AzureBlobPropertiesBuilder
cloudfiles.contextbuilder=org.jclouds.rackspace.cloudfiles.blobstore.CloudFilesBlobStoreContextBuilder

View File

@ -21,6 +21,8 @@
# under the License.
# ====================================================================
#
atmos.contextbuilder=org.jclouds.atmosonline.saas.blobstore.AtmosBlobStoreContextBuilder
atmos.propertiesbuilder=org.jclouds.atmosonline.saas.AtmosStoragePropertiesBuilder
azureblob.contextbuilder=org.jclouds.azure.storage.blob.blobstore.AzureBlobStoreContextBuilder
azureblob.propertiesbuilder=org.jclouds.azure.storage.blob.AzureBlobPropertiesBuilder
cloudfiles.contextbuilder=org.jclouds.rackspace.cloudfiles.blobstore.CloudFilesBlobStoreContextBuilder