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

COVERAGE SUMMARY FOR SOURCE FILE [CreateContainerOptions.java]

nameclass, %method, %block, %line, %
CreateContainerOptions.java100% (2/2)86%  (6/7)93%  (42/45)95%  (10.5/11)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CreateContainerOptions$Builder100% (1/1)67%  (2/3)84%  (16/19)80%  (4/5)
CreateContainerOptions$Builder (): void 0%   (0/1)0%   (0/3)0%   (0/1)
withMetadata (Multimap): CreateContainerOptions 100% (1/1)100% (8/8)100% (2/2)
withPublicAccess (PublicAccess): CreateContainerOptions 100% (1/1)100% (8/8)100% (2/2)
     
class CreateContainerOptions100% (1/1)100% (4/4)100% (26/26)100% (7/7)
<static initializer> 100% (1/1)100% (5/5)100% (1/1)
CreateContainerOptions (): void 100% (1/1)100% (3/3)100% (2/2)
withMetadata (Multimap): CreateContainerOptions 100% (1/1)100% (5/5)100% (1/1)
withPublicAccess (PublicAccess): CreateContainerOptions 100% (1/1)100% (13/13)100% (3/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.azureblob.options;
20 
21import org.jclouds.azure.storage.options.CreateOptions;
22import org.jclouds.azureblob.domain.PublicAccess;
23 
24import com.google.common.collect.Multimap;
25 
26/**
27 * Contains options supported in the REST API for the Create Container operation. <h2>
28 * Usage</h2> The recommended way to instantiate a CreateContainerOptions object is to statically
29 * import CreateContainerOptions.* and invoke a static creation method followed by an instance
30 * mutator (if needed):
31 * <p/>
32 * <code>
33 * import static org.jclouds.azureblob.options.CreateContainerOptions.Builder.*
34 * import org.jclouds.azureblob.AzureBlobClient;
35 * <p/>
36 * AzureBlobClient connection = // get connection
37 * boolean createdWithPublicAccess = connection.createContainer("containerName", withPublicAccess(PublicAccess.BLOB));
38 * <code> *
39 * 
40 * @see <a href="http://msdn.microsoft.com/en-us/library/dd179466.aspx" />
41 * @author Adrian Cole
42 */
43public class CreateContainerOptions extends CreateOptions {
44   public static final CreateContainerOptions NONE = new CreateContainerOptions();
45 
46   @Override
47   public CreateContainerOptions withMetadata(Multimap<String, String> metadata) {
48      return (CreateContainerOptions) super.withMetadata(metadata);
49   }
50 
51   /**
52    * Indicates whether a container may be accessed publicly
53    */
54   public CreateContainerOptions withPublicAccess(PublicAccess access) {
55      if (access != PublicAccess.PRIVATE)
56         this.headers.put("x-ms-blob-public-access", access.name().toLowerCase());
57      return this;
58   }
59 
60   public static class Builder {
61 
62      /**
63       * @see CreateContainerOptions#withPublicAccess
64       */
65      public static CreateContainerOptions withPublicAccess(PublicAccess access) {
66         CreateContainerOptions options = new CreateContainerOptions();
67         return options.withPublicAccess(access);
68      }
69 
70      /**
71       * @see CreateContainerOptions#withMetadata(Multimap<String, String>)
72       */
73      public static CreateContainerOptions withMetadata(Multimap<String, String> metadata) {
74         CreateContainerOptions options = new CreateContainerOptions();
75         return (CreateContainerOptions) options.withMetadata(metadata);
76      }
77 
78   }
79}

[all classes][org.jclouds.azureblob.options]
EMMA 2.0.5312 (C) Vladimir Roubtsov