kopia lustrzana https://github.com/gaul/s3proxy
Add Google Cloud Storage provider
Also convert ETag from GCS-style base64 to AWS-style base16.pull/20/head
rodzic
7042b02212
commit
4a58f00885
|
@ -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
|
||||
|
|
5
pom.xml
5
pom.xml
|
@ -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>
|
||||
|
|
|
@ -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>"");
|
||||
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(""</ETag>\r\n");
|
||||
|
|
Ładowanie…
Reference in New Issue