From faa1710aaeba1f8b4403d185adea0a632bb10fc5 Mon Sep 17 00:00:00 2001 From: Nguyen Quoc Viet Date: Thu, 12 Sep 2019 23:18:50 +0700 Subject: [PATCH 1/2] CreateUpdateContainerOptions and SwiftHeaders doesn't support X-History-Location header Added HISTORY_LOCATION = "X-History-Location" to SwiftHeaders Added function "historyLocation" to explicitly support history location on containers Closes-Issue: #1267 --- .../model/storage/object/SwiftHeaders.java | 1 + .../options/CreateUpdateContainerOptions.java | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/core/src/main/java/org/openstack4j/model/storage/object/SwiftHeaders.java b/core/src/main/java/org/openstack4j/model/storage/object/SwiftHeaders.java index 92fe15787..3cf4fb197 100644 --- a/core/src/main/java/org/openstack4j/model/storage/object/SwiftHeaders.java +++ b/core/src/main/java/org/openstack4j/model/storage/object/SwiftHeaders.java @@ -24,6 +24,7 @@ public final class SwiftHeaders { // Versioning public static final String VERSIONS_LOCATION = "X-Versions-Location"; + public static final String HISTORY_LOCATION = "X-History-Location"; // ACL's (not all implementations support this) public static final String CONTAINER_READ = "X-Container-Read"; diff --git a/core/src/main/java/org/openstack4j/model/storage/object/options/CreateUpdateContainerOptions.java b/core/src/main/java/org/openstack4j/model/storage/object/options/CreateUpdateContainerOptions.java index 44a88604b..7cb6d0477 100644 --- a/core/src/main/java/org/openstack4j/model/storage/object/options/CreateUpdateContainerOptions.java +++ b/core/src/main/java/org/openstack4j/model/storage/object/options/CreateUpdateContainerOptions.java @@ -62,6 +62,19 @@ public CreateUpdateContainerOptions versionsLocation(String containerName) { add(VERSIONS_LOCATION, containerName); return this; } + + /** + * Enables history versioning mode on this container. The value is the name of another container. + * You must UTF-8-encode and then URL-encode the name before you include it in the header. + * To disable versioning, set the header to an empty string. + * + * @param containerName the container name of the other container + * @return CreateUpdateContainerOptions + */ + public CreateUpdateContainerOptions historyLocation(String containerName) { + add(HISTORY_LOCATION, containerName); + return this; + } /** * Sets the read ACL (if supported) to allow public access From c51d8f70663d14ba670092e96cf2fe9fd2261e44 Mon Sep 17 00:00:00 2001 From: Nguyen Quoc Viet Date: Sat, 14 Sep 2019 19:48:42 +0700 Subject: [PATCH 2/2] Specify distribution for travis config Added dist: trusty to fix oraclejdk8 error when installing --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index c5c1d1991..185d94257 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,3 +36,8 @@ after_success: # infrastructure. This should prevent the buffer overflow from # https://github.com/travis-ci/travis-ci/issues/5227 sudo: false + +# due to travis-ci changes in default build environment, +# this must be specify in order for oraclejdk8 to install +# https://blog.travis-ci.com/2019-04-15-xenial-default-build-environment +dist: trusty