EMMA Coverage Report (generated Mon Oct 17 05:41:20 EDT 2011)
[all classes][org.jclouds.cloudfiles.blobstore]

COVERAGE SUMMARY FOR SOURCE FILE [CloudFilesBlobStore.java]

nameclass, %method, %block, %line, %
CloudFilesBlobStore.java0%   (0/1)0%   (0/2)0%   (0/45)0%   (0/6)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CloudFilesBlobStore0%   (0/1)0%   (0/2)0%   (0/45)0%   (0/6)
CloudFilesBlobStore (BlobStoreContext, BlobUtils, Supplier, Supplier, CommonS... 0%   (0/1)0%   (0/19)0%   (0/3)
createContainerInLocation (Location, String, CreateContainerOptions): boolean 0%   (0/1)0%   (0/26)0%   (0/3)

1/**
2 * Licensed to jclouds, Inc. (jclouds) under one or more
3 * contributor license agreements.  See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership.  jclouds licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License.  You may obtain a copy of the License at
9 *
10 *   http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied.  See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19package org.jclouds.cloudfiles.blobstore;
20 
21import java.util.Set;
22 
23import javax.inject.Inject;
24import javax.inject.Provider;
25import javax.inject.Singleton;
26 
27import org.jclouds.blobstore.BlobStoreContext;
28import org.jclouds.blobstore.functions.BlobToHttpGetOptions;
29import org.jclouds.blobstore.options.CreateContainerOptions;
30import org.jclouds.blobstore.strategy.internal.FetchBlobMetadata;
31import org.jclouds.blobstore.util.BlobUtils;
32import org.jclouds.cloudfiles.blobstore.functions.EnableCDNAndCache;
33import org.jclouds.collect.Memoized;
34import org.jclouds.domain.Location;
35import org.jclouds.openstack.swift.CommonSwiftClient;
36import org.jclouds.openstack.swift.blobstore.SwiftBlobStore;
37import org.jclouds.openstack.swift.blobstore.functions.BlobStoreListContainerOptionsToListContainerOptions;
38import org.jclouds.openstack.swift.blobstore.functions.BlobToObject;
39import org.jclouds.openstack.swift.blobstore.functions.ContainerToResourceList;
40import org.jclouds.openstack.swift.blobstore.functions.ContainerToResourceMetadata;
41import org.jclouds.openstack.swift.blobstore.functions.ObjectToBlob;
42import org.jclouds.openstack.swift.blobstore.functions.ObjectToBlobMetadata;
43 
44import com.google.common.base.Supplier;
45 
46/**
47 * 
48 * @author Adrian Cole
49 */
50@Singleton
51public class CloudFilesBlobStore extends SwiftBlobStore {
52 
53   private EnableCDNAndCache enableCDNAndCache;
54 
55   @Inject
56   protected CloudFilesBlobStore(BlobStoreContext context, BlobUtils blobUtils, Supplier<Location> defaultLocation,
57            @Memoized Supplier<Set<? extends Location>> locations, CommonSwiftClient sync,
58            ContainerToResourceMetadata container2ResourceMd,
59            BlobStoreListContainerOptionsToListContainerOptions container2ContainerListOptions,
60            ContainerToResourceList container2ResourceList, ObjectToBlob object2Blob, BlobToObject blob2Object,
61            ObjectToBlobMetadata object2BlobMd, BlobToHttpGetOptions blob2ObjectGetOptions,
62            Provider<FetchBlobMetadata> fetchBlobMetadataProvider, EnableCDNAndCache enableCDNAndCache) {
63      super(context, blobUtils, defaultLocation, locations, sync, container2ResourceMd, container2ContainerListOptions,
64               container2ResourceList, object2Blob, blob2Object, object2BlobMd, blob2ObjectGetOptions,
65               fetchBlobMetadataProvider);
66      this.enableCDNAndCache = enableCDNAndCache;
67 
68   }
69 
70   @Override
71   public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options) {
72      try {
73         return createContainerInLocation(location, container);
74      } finally {
75         if (options.isPublicRead())
76            enableCDNAndCache.apply(container);
77      }
78   }
79}

[all classes][org.jclouds.cloudfiles.blobstore]
EMMA 2.0.5312 (C) Vladimir Roubtsov