/** Returns the requested storage object or {@code null} if not found. */ @Override public StorageObject get(StorageObject object, Map<Option, ?> options) throws StorageException { // we allow the "ID" option because we need to, but then we give a whole answer anyways // because the caller won't mind the extra fields. if (throwIfOption && !options.isEmpty() && options.size() > 1 && options.keySet().toArray()[0] != Storage.BlobGetOption.fields(Storage.BlobField.ID)) { throw new UnsupportedOperationException(); } String key = fullname(object); if (metadata.containsKey(key)) { StorageObject ret = metadata.get(key); if (contents.containsKey(key)) { ret.setSize(BigInteger.valueOf(contents.get(key).length)); } ret.setId(key); return ret; } return null; }
storageObject.setContentLanguage(contentLanguage); storageObject.setEtag(etag); storageObject.setId(generatedId); storageObject.setSelfLink(selfLink); return storageObject;
/** * Returns the requested storage object or {@code null} if not found. */ @Override public StorageObject get(StorageObject object, Map<Option, ?> options) throws StorageException { // we allow the "ID" option because we need to, but then we give a whole answer anyways // because the caller won't mind the extra fields. if (throwIfOption && !options.isEmpty() && options.size() > 1 && options.keySet().toArray()[0] != Storage.BlobGetOption.fields(Storage.BlobField.ID)) { throw new UnsupportedOperationException(); } String key = fullname(object); if (metadata.containsKey(key)) { StorageObject ret = metadata.get(key); if (contents.containsKey(key)) { ret.setSize(BigInteger.valueOf(contents.get(key).length)); } ret.setId(key); return ret; } return null; }
storageObject.setContentLanguage(contentLanguage); storageObject.setEtag(etag); storageObject.setId(generatedId); storageObject.setSelfLink(selfLink); return storageObject;
storageObject.setContentLanguage(contentLanguage); storageObject.setEtag(etag); storageObject.setId(generatedId); storageObject.setSelfLink(selfLink); return storageObject;