EMMA Coverage Report (generated Wed Aug 10 12:30:04 EDT 2011)
[all classes][org.jclouds.io.payloads]

COVERAGE SUMMARY FOR SOURCE FILE [InputStreamPayload.java]

nameclass, %method, %block, %line, %
InputStreamPayload.java100% (1/1)100% (4/4)100% (15/15)100% (6/6)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class InputStreamPayload100% (1/1)100% (4/4)100% (15/15)100% (6/6)
InputStreamPayload (InputStream): void 100% (1/1)100% (4/4)100% (2/2)
getInput (): InputStream 100% (1/1)100% (4/4)100% (1/1)
isRepeatable (): boolean 100% (1/1)100% (2/2)100% (1/1)
release (): void 100% (1/1)100% (5/5)100% (2/2)

1/**
2 *
3 * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4 *
5 * ====================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * 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, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ====================================================================
18 */
19package org.jclouds.io.payloads;
20 
21import static com.google.common.io.Closeables.closeQuietly;
22 
23import java.io.InputStream;
24 
25/**
26 * @author Adrian Cole
27 */
28public class InputStreamPayload extends BasePayload<InputStream> {
29 
30   public InputStreamPayload(InputStream content) {
31      super(content);
32   }
33 
34   /**
35    * {@inheritDoc}
36    */
37   @Override
38   public InputStream getInput() {
39      return content;
40   }
41 
42   /**
43    * {@inheritDoc}
44    */
45   @Override
46   public boolean isRepeatable() {
47      return false;
48   }
49 
50   /**
51    * if we created the stream, then it is already consumed on close.
52    */
53   @Override
54   public void release() {
55      closeQuietly(content);
56   }
57 
58}

[all classes][org.jclouds.io.payloads]
EMMA 2.0.5312 (C) Vladimir Roubtsov