use of org.openstack.model.storage.StorageObject in project platformlayer by platformlayer.
the class OpenstackCasStore method findArtifact.
@Override
public CasStoreObject findArtifact(Md5Hash hash) {
OpenstackStorageClient storageClient = getStorageClient();
try {
List<StorageObject> storageObjects = Lists.newArrayList(storageClient.listObjects(containerName, null, null));
String findHash = hash.toHex();
for (StorageObject storageObject : storageObjects) {
String storageObjectHash = storageObject.getHash();
if (storageObjectHash.equalsIgnoreCase(findHash)) {
return new OpenstackCasObject(storageObject);
}
}
} catch (OpenstackNotFoundException e) {
log.debug("Not found (404) returned from Openstack");
return null;
}
return null;
}
Aggregations