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

COVERAGE SUMMARY FOR SOURCE FILE [FileSystemBlobUtilsImpl.java]

nameclass, %method, %block, %line, %
FileSystemBlobUtilsImpl.java100% (1/1)38%  (3/8)46%  (26/56)50%  (7/14)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FileSystemBlobUtilsImpl100% (1/1)38%  (3/8)46%  (26/56)50%  (7/14)
countBlobs (String, ListContainerOptions): long 0%   (0/1)0%   (0/6)0%   (0/1)
createDirectory (String, String): void 0%   (0/1)0%   (0/6)0%   (0/2)
deleteDirectory (String, String): void 0%   (0/1)0%   (0/6)0%   (0/2)
directoryExists (String, String): boolean 0%   (0/1)0%   (0/6)0%   (0/1)
newBlob (String): Blob 0%   (0/1)0%   (0/6)0%   (0/1)
FileSystemBlobUtilsImpl (FilesystemStorageStrategy, Provider): void 100% (1/1)100% (15/15)100% (4/4)
blobBuilder (): BlobBuilder 100% (1/1)100% (5/5)100% (1/1)
clearContainer (String, ListContainerOptions): void 100% (1/1)100% (6/6)100% (2/2)

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.filesystem.util.internal;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import javax.inject.Provider;
24 
25import org.jclouds.blobstore.AsyncBlobStore;
26import org.jclouds.blobstore.domain.Blob;
27import org.jclouds.blobstore.domain.BlobBuilder;
28import org.jclouds.blobstore.options.ListContainerOptions;
29import org.jclouds.blobstore.util.BlobUtils;
30import org.jclouds.filesystem.strategy.FilesystemStorageStrategy;
31 
32import com.google.inject.Inject;
33 
34/**
35 * Implements the {@link BlobUtils} interfaced and act as a bridge to
36 * {@link FilesystemStorageStrategy} when used inside {@link AsyncBlobStore}
37 * 
38 * @author Alfredo "Rainbowbreeze" Morresi
39 */
40public class FileSystemBlobUtilsImpl implements BlobUtils {
41 
42   protected final FilesystemStorageStrategy storageStrategy;
43   protected final Provider<BlobBuilder> blobBuilders;
44 
45   @Inject
46   public FileSystemBlobUtilsImpl(FilesystemStorageStrategy storageStrategy, Provider<BlobBuilder> blobBuilders) {
47      this.storageStrategy = checkNotNull(storageStrategy, "Filesystem Storage Strategy");
48      this.blobBuilders = checkNotNull(blobBuilders, "Filesystem  blobBuilders");
49   }
50 
51   @Override
52   public Blob newBlob(String name) {
53      return blobBuilder().name(name).build();
54   }
55 
56   @Override
57   public BlobBuilder blobBuilder() {
58      return blobBuilders.get();
59   }
60 
61   @Override
62   public boolean directoryExists(String containerName, String directory) {
63      return storageStrategy.directoryExists(containerName, directory);
64   }
65 
66   @Override
67   public void createDirectory(String containerName, String directory) {
68      storageStrategy.createDirectory(containerName, directory);
69   }
70 
71   @Override
72   public long countBlobs(String container, ListContainerOptions options) {
73      return storageStrategy.countBlobs(container, options);
74   }
75 
76   @Override
77   public void clearContainer(String container, ListContainerOptions options) {
78      storageStrategy.clearContainer(container, options);
79   }
80 
81   @Override
82   public void deleteDirectory(String container, String directory) {
83      storageStrategy.deleteDirectory(container, directory);
84   }
85 
86}

[all classes][org.jclouds.filesystem.util.internal]
EMMA 2.0.5312 (C) Vladimir Roubtsov