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:
parent
7e2723c9a4
commit
70f0635ac2
@ -191,10 +191,12 @@ public class RegionScopedSwiftBlobStore implements BlobStore {
|
|||||||
@Override
|
@Override
|
||||||
public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options) {
|
public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options) {
|
||||||
checkArgument(location == null || location.equals(region), "location must be null or %s", region);
|
checkArgument(location == null || location.equals(region), "location must be null or %s", region);
|
||||||
if (options.isPublicRead()) {
|
boolean containerCreated = api.getContainerApi(regionId).create(container, options.isPublicRead() ? ANYBODY_READ : BASIC_CONTAINER);
|
||||||
return api.getContainerApi(regionId).create(container, ANYBODY_READ);
|
|
||||||
|
if (containerCreated) {
|
||||||
|
containerCache.put(container, Optional.fromNullable(api.getContainerApi(regionId).get(container)));
|
||||||
}
|
}
|
||||||
return api.getContainerApi(regionId).create(container, BASIC_CONTAINER);
|
return containerCreated;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user