Add Google Cloud Storage provider

Also convert ETag from GCS-style base64 to AWS-style base16.
pull/20/head
Andrew Gaul 2014-09-04 19:55:19 -07:00
rodzic 7042b02212
commit 4a58f00885
3 zmienionych plików z 11 dodań i 0 usunięć

Wyświetl plik

@ -22,6 +22,7 @@ Supported object stores:
* azureblob
* cloudfiles-uk and cloudfiles-us
* filesystem (on-disk storage)
* google-cloud-storage
* hpcloud-objectstorage
* s3
* swift and swift-keystone

Wyświetl plik

@ -204,6 +204,11 @@
<artifactId>glacier</artifactId>
<version>${jclouds.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jclouds.labs</groupId>
<artifactId>google-cloud-storage</artifactId>
<version>${jclouds.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>

Wyświetl plik

@ -552,6 +552,8 @@ final class S3ProxyHandler extends AbstractHandler {
}
String eTag = metadata.getETag();
if (eTag != null) {
String id = blobStore.getContext().unwrap()
.getProviderMetadata().getId();
writer.write(" <ETag>&quot;");
if (eTag.startsWith("0x")) {
// Azure returns Etag as 0x8D1895E13DF8EF1 but S3
@ -561,6 +563,9 @@ final class S3ProxyHandler extends AbstractHandler {
writer.write(Strings.repeat("0", 16 -
eTag.length()));
}
} else if (id.equals("google-cloud-storage")) {
eTag = BaseEncoding.base16().lowerCase().encode(
BaseEncoding.base64().decode(eTag));
}
writer.write(eTag);
writer.write("&quot;</ETag>\r\n");