1
0
mirror of https://github.com/apache/jclouds.git synced 2025-02-27 21:09:07 +00:00

JCLOUDS-1479: populate container cache on create

This commit is contained in:
duc 2019-01-02 15:45:11 +07:00 committed by Andrew Gaul
parent 7e2723c9a4
commit 70f0635ac2

@ -191,10 +191,12 @@ public class RegionScopedSwiftBlobStore implements BlobStore {
@Override
public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options) {
checkArgument(location == null || location.equals(region), "location must be null or %s", region);
if (options.isPublicRead()) {
return api.getContainerApi(regionId).create(container, ANYBODY_READ);
boolean containerCreated = api.getContainerApi(regionId).create(container, options.isPublicRead() ? ANYBODY_READ : BASIC_CONTAINER);
if (containerCreated) {
containerCache.put(container, Optional.fromNullable(api.getContainerApi(regionId).get(container)));
}
return api.getContainerApi(regionId).create(container, BASIC_CONTAINER);
return containerCreated;
}
@Override