}
public MutableBlobMetadata apply(BlobProperties from) {
if (from == null)
return null;
MutableBlobMetadata to = new MutableBlobMetadataImpl();
HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata());
to.setUserMetadata(from.getMetadata());
to.setETag(from.getETag());
to.setLastModified(from.getLastModified());
to.setName(from.getName());
to.setContainer(from.getContainer());
to.setUri(from.getUrl());
if (from.getContainer() != null)
try {
PublicAccess containerAcl = containerAcls.getUnchecked(from.getContainer());
if (containerAcl != PublicAccess.PRIVATE)
to.setPublicUri(from.getUrl());
} catch (CacheLoader.InvalidCacheLoadException e) {
// nulls not permitted from cache loader
}
String directoryName = ifDirectoryReturnName.execute(to);
if (directoryName != null) {
to.setName(directoryName);
to.setType(StorageType.RELATIVE_PATH);
} else {
to.setType(StorageType.BLOB);
}
return to;
}