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