jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Phillips <notificati...@github.com>
Subject Re: [jclouds-labs-aws] JCLOUDS-457: Add list operation (#46)
Date Sat, 02 Aug 2014 00:51:34 GMT
> +import org.jclouds.io.MutableContentMetadata;
> +import org.jclouds.io.payloads.BaseMutableContentMetadata;
> +
> +import com.google.common.base.Function;
> +import com.google.common.collect.ImmutableMap;
> +
> +public class ArchiveMetadataToBlobMetadata implements Function<ArchiveMetadata, MutableBlobMetadata>
{
> +   @Override
> +   public MutableBlobMetadata apply(ArchiveMetadata from) {
> +      MutableContentMetadata contentMetadata = new BaseMutableContentMetadata();
> +      contentMetadata.setContentLength(from.getSize());
> +
> +      MutableBlobMetadata to = new MutableBlobMetadataImpl();
> +      to.setName(from.getArchiveId());
> +      to.setCreationDate(from.getCreationDate());
> +      to.setUserMetadata(ImmutableMap.<String, String>of());

User metadata is initialized by default already: https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/domain/internal/MutableResourceMetadataImpl.java#L41

Do we therefore need this? Or is it important that we are setting an _immutable_ map here?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/46/files#r15725669
Mime
View raw message