public Blob apply(AtmosObject from) { if (from == null) return null; Blob blob = blobFactory.create(object2BlobMd.apply(from)); blob.setPayload(checkNotNull(from.getPayload(), "payload: " + from)); HttpUtils.copy(from.getContentMetadata(), blob.getPayload().getContentMetadata()); blob.setAllHeaders(from.getAllHeaders()); return blob; } }
public Blob apply(AtmosObject from) { if (from == null) return null; Blob blob = blobFactory.create(object2BlobMd.apply(from)); blob.setPayload(checkNotNull(from.getPayload(), "payload: " + from)); HttpUtils.copy(from.getContentMetadata(), blob.getPayload().getContentMetadata()); blob.setAllHeaders(from.getAllHeaders()); return blob; } }
public Blob apply(AtmosObject from) { if (from == null) return null; Blob blob = blobFactory.create(object2BlobMd.apply(from)); blob.setPayload(checkNotNull(from.getPayload(), "payload: " + from)); HttpUtils.copy(from.getContentMetadata(), blob.getPayload().getContentMetadata()); blob.setAllHeaders(from.getAllHeaders()); return blob; } }
public Blob apply(AtmosObject from) { if (from == null) return null; Blob blob = blobFactory.create(object2BlobMd.apply(from)); blob.setPayload(checkNotNull(from.getPayload(), "payload: " + from)); HttpUtils.copy(from.getContentMetadata(), blob.getPayload().getContentMetadata()); blob.setAllHeaders(from.getAllHeaders()); return blob; } }
public Blob apply(AtmosObject from) { if (from == null) return null; Blob blob = blobFactory.create(object2BlobMd.apply(from)); blob.setPayload(checkNotNull(from.getPayload(), "payload: " + from)); HttpUtils.copy(from.getContentMetadata(), blob.getPayload().getContentMetadata()); blob.setAllHeaders(from.getAllHeaders()); return blob; } }
public Blob apply(AtmosObject from) { if (from == null) return null; Blob blob = blobFactory.create(object2BlobMd.apply(from)); blob.setPayload(checkNotNull(from.getPayload(), "payload: " + from)); HttpUtils.copy(from.getContentMetadata(), blob.getPayload().getContentMetadata()); blob.setAllHeaders(from.getAllHeaders()); return blob; } }
public Blob apply(AtmosObject from) { if (from == null) return null; Blob blob = blobFactory.create(object2BlobMd.apply(from)); blob.setPayload(checkNotNull(from.getPayload(), "payload: " + from)); HttpUtils.copy(from.getContentMetadata(), blob.getPayload().getContentMetadata()); blob.setAllHeaders(from.getAllHeaders()); return blob; } }
public MutableBlobMetadata apply(AtmosObject from) { if (from == null) return null; MutableBlobMetadata to = new MutableBlobMetadataImpl(); to.setId(from.getSystemMetadata().getObjectID()); to.setLastModified(from.getSystemMetadata().getLastUserDataModification()); HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata()); to.setName(objectName.apply(from)); to.setUri(from.getContentMetadata().getUri()); to.setContainer(Iterables.get(Splitter.on('/').split(from.getContentMetadata().getPath()), 0)); if (from.getAllHeaders().containsEntry("x-emc-groupacl", "other=READ")) to.setPublicUri(shareUrl.apply(from.getContentMetadata().getPath())); if (from.getSystemMetadata().getType() == FileType.DIRECTORY) { to.setType(StorageType.FOLDER); } else { to.setType(StorageType.BLOB); } Map<String, String> lowerKeyMetadata = Maps.newHashMap(); for (Entry<String, String> entry : from.getUserMetadata().getMetadata().entrySet()) { String key = entry.getKey().toLowerCase(); if (!systemMetadata.contains(key)) lowerKeyMetadata.put(key, entry.getValue()); } to.setUserMetadata(lowerKeyMetadata); to.setSize(from.getContentMetadata().getContentLength()); return to; } }
public MutableBlobMetadata apply(AtmosObject from) { if (from == null) return null; MutableBlobMetadata to = new MutableBlobMetadataImpl(); to.setId(from.getSystemMetadata().getObjectID()); to.setLastModified(from.getSystemMetadata().getLastUserDataModification()); HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata()); to.setName(objectName.apply(from)); to.setUri(from.getContentMetadata().getUri()); to.setContainer(Iterables.get(Splitter.on('/').split(from.getContentMetadata().getPath()),0)); if (from.getAllHeaders().containsEntry("x-emc-groupacl", "other=READ")) to.setPublicUri(shareUrl.apply(from.getContentMetadata().getPath())); if (from.getSystemMetadata().getType() == FileType.DIRECTORY) { to.setType(StorageType.FOLDER); } else { to.setType(StorageType.BLOB); } Map<String, String> lowerKeyMetadata = Maps.newHashMap(); for (Entry<String, String> entry : from.getUserMetadata().getMetadata().entrySet()) { String key = entry.getKey().toLowerCase(); if (!systemMetadata.contains(key)) lowerKeyMetadata.put(key, entry.getValue()); } to.setUserMetadata(lowerKeyMetadata); return to; } }
public MutableBlobMetadata apply(AtmosObject from) { if (from == null) return null; MutableBlobMetadata to = new MutableBlobMetadataImpl(); to.setId(from.getSystemMetadata().getObjectID()); to.setLastModified(from.getSystemMetadata().getLastUserDataModification()); HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata()); to.setName(objectName.apply(from)); to.setUri(from.getContentMetadata().getUri()); to.setContainer(Iterables.get(Splitter.on('/').split(from.getContentMetadata().getPath()),0)); if (from.getAllHeaders().containsEntry("x-emc-groupacl", "other=READ")) to.setPublicUri(shareUrl.apply(from.getContentMetadata().getPath())); if (from.getSystemMetadata().getType() == FileType.DIRECTORY) { to.setType(StorageType.FOLDER); } else { to.setType(StorageType.BLOB); } Map<String, String> lowerKeyMetadata = Maps.newHashMap(); for (Entry<String, String> entry : from.getUserMetadata().getMetadata().entrySet()) { String key = entry.getKey().toLowerCase(); if (!systemMetadata.contains(key)) lowerKeyMetadata.put(key, entry.getValue()); } to.setUserMetadata(lowerKeyMetadata); return to; } }
public MutableBlobMetadata apply(AtmosObject from) { if (from == null) return null; MutableBlobMetadata to = new MutableBlobMetadataImpl(); to.setId(from.getSystemMetadata().getObjectID()); to.setLastModified(from.getSystemMetadata().getLastUserDataModification()); HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata()); to.setName(objectName.apply(from)); to.setUri(from.getContentMetadata().getUri()); to.setContainer(Iterables.get(Splitter.on('/').split(from.getContentMetadata().getPath()),0)); if (from.getAllHeaders().containsEntry("x-emc-groupacl", "other=READ")) to.setPublicUri(shareUrl.apply(from.getContentMetadata().getPath())); if (from.getSystemMetadata().getType() == FileType.DIRECTORY) { to.setType(StorageType.FOLDER); } else { to.setType(StorageType.BLOB); } Map<String, String> lowerKeyMetadata = Maps.newHashMap(); for (Entry<String, String> entry : from.getUserMetadata().getMetadata().entrySet()) { String key = entry.getKey().toLowerCase(); if (!systemMetadata.contains(key)) lowerKeyMetadata.put(key, entry.getValue()); } to.setUserMetadata(lowerKeyMetadata); return to; } }
public MutableBlobMetadata apply(AtmosObject from) { if (from == null) return null; MutableBlobMetadata to = new MutableBlobMetadataImpl(); to.setId(from.getSystemMetadata().getObjectID()); to.setLastModified(from.getSystemMetadata().getLastUserDataModification()); HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata()); to.setName(objectName.apply(from)); to.setUri(from.getContentMetadata().getUri()); to.setContainer(Iterables.get(Splitter.on('/').split(from.getContentMetadata().getPath()), 0)); if (from.getAllHeaders().containsEntry("x-emc-groupacl", "other=READ")) to.setPublicUri(shareUrl.apply(from.getContentMetadata().getPath())); if (from.getSystemMetadata().getType() == FileType.DIRECTORY) { to.setType(StorageType.FOLDER); } else { to.setType(StorageType.BLOB); } Map<String, String> lowerKeyMetadata = Maps.newHashMap(); for (Entry<String, String> entry : from.getUserMetadata().getMetadata().entrySet()) { String key = entry.getKey().toLowerCase(); if (!systemMetadata.contains(key)) lowerKeyMetadata.put(key, entry.getValue()); } to.setUserMetadata(lowerKeyMetadata); to.setSize(from.getContentMetadata().getContentLength()); return to; } }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); return object; }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); return object; }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); return object; }
to.setUri(from.getContentMetadata().getUri()); to.setContainer(Iterables.get(Splitter.on('/').split(from.getContentMetadata().getPath()), 0)); if (from.getAllHeaders().containsEntry("x-emc-groupacl", "other=READ")) to.setPublicUri(shareUrl.apply(from.getContentMetadata().getPath())); if (from.getSystemMetadata().getType() == FileType.DIRECTORY) {
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); return object; }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); return object; }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); object.getContentMetadata().setContentMD5(object.getSystemMetadata().getContentMD5()); return object; }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); object.getContentMetadata().setContentMD5(object.getSystemMetadata().getContentMD5()); return object; }