EMMA Coverage Report (generated Wed Oct 26 13:47:17 EDT 2011)
[all classes][org.jclouds.util]

COVERAGE SUMMARY FOR SOURCE FILE [Utils.java]

nameclass, %method, %block, %line, %
Utils.java0%   (0/1)0%   (0/30)0%   (0/113)0%   (0/32)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Utils0%   (0/1)0%   (0/30)0%   (0/113)0%   (0/32)
Utils (): void 0%   (0/1)0%   (0/3)0%   (0/1)
checkNotEmpty (String): void 0%   (0/1)0%   (0/3)0%   (0/2)
checkNotEmpty (String, String): void 0%   (0/1)0%   (0/4)0%   (0/2)
encodeString (String): byte [] 0%   (0/1)0%   (0/3)0%   (0/1)
encodeString (String, String): byte [] 0%   (0/1)0%   (0/4)0%   (0/1)
eventuallyTrue (Supplier, long): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
getFirstThrowableOfType (ProvisionException, Class): Throwable 0%   (0/1)0%   (0/4)0%   (0/1)
getFirstThrowableOfType (Throwable, Class): Throwable 0%   (0/1)0%   (0/4)0%   (0/1)
getSupportedProviders (): Iterable 0%   (0/1)0%   (0/2)0%   (0/1)
getSupportedProvidersOfType (Class): Iterable 0%   (0/1)0%   (0/3)0%   (0/1)
getSupportedProvidersOfTypeInProperties (Class, Properties): Iterable 0%   (0/1)0%   (0/4)0%   (0/1)
initContextBuilder (Class, Class, Class, Properties): RestContextBuilder 0%   (0/1)0%   (0/6)0%   (0/1)
isPrivateKeyCredential (Credentials): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
modulesForProviderInProperties (String, Properties): Iterable 0%   (0/1)0%   (0/4)0%   (0/1)
modulesFromCommaDelimitedString (String): Iterable 0%   (0/1)0%   (0/3)0%   (0/1)
modulesFromProperty (Properties, String): Iterable 0%   (0/1)0%   (0/4)0%   (0/1)
multiMax (Comparator, Iterable): List 0%   (0/1)0%   (0/4)0%   (0/1)
newOutputStreamSupplier (OutputStream): OutputSupplier 0%   (0/1)0%   (0/3)0%   (0/1)
overrideCredentialsIfSupplied (Credentials, Credentials): Credentials 0%   (0/1)0%   (0/4)0%   (0/1)
propagateAuthorizationOrOriginalException (Exception): Object 0%   (0/1)0%   (0/3)0%   (0/1)
propagateOrNull (Exception): Object 0%   (0/1)0%   (0/3)0%   (0/1)
replaceAll (String, Pattern, String): String 0%   (0/1)0%   (0/5)0%   (0/1)
replaceAll (String, char, Pattern, String): String 0%   (0/1)0%   (0/6)0%   (0/1)
replaceAll (String, char, String): String 0%   (0/1)0%   (0/5)0%   (0/1)
replaceTokens (String, Iterable): String 0%   (0/1)0%   (0/4)0%   (0/1)
replaceTokens (String, Map): String 0%   (0/1)0%   (0/4)0%   (0/1)
resolveContextBuilderClass (String, Properties): Class 0%   (0/1)0%   (0/4)0%   (0/1)
resolvePropertiesBuilderClass (String, Properties): Class 0%   (0/1)0%   (0/4)0%   (0/1)
toInputStream (String): InputStream 0%   (0/1)0%   (0/3)0%   (0/1)
toStringAndClose (InputStream): String 0%   (0/1)0%   (0/3)0%   (0/1)

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.util;
20 
21import java.io.IOException;
22import java.io.InputStream;
23import java.io.OutputStream;
24import java.lang.reflect.InvocationTargetException;
25import java.util.Comparator;
26import java.util.List;
27import java.util.Map;
28import java.util.Properties;
29import java.util.Map.Entry;
30import java.util.regex.Pattern;
31 
32import org.jclouds.javax.annotation.Nullable;
33 
34import org.jclouds.PropertiesBuilder;
35import org.jclouds.domain.Credentials;
36import org.jclouds.rest.Providers;
37import org.jclouds.rest.RestContextBuilder;
38 
39import com.google.common.base.Supplier;
40import com.google.common.io.OutputSupplier;
41import com.google.inject.Module;
42import com.google.inject.ProvisionException;
43import com.google.inject.util.Modules;
44 
45/**
46 * General utilities used in jclouds code.
47 * 
48 * <h4>note</h4> Please look for locations of new utility methods
49 * 
50 * @author Adrian Cole
51 */
52@Deprecated
53public class Utils {
54 
55   /**
56    * 
57    * @see Throwables2.propagateAuthorizationOrOriginalException
58    */
59   @Deprecated
60   public static <T> T propagateAuthorizationOrOriginalException(Exception e) {
61      return Throwables2.<T> propagateAuthorizationOrOriginalException(e);
62   }
63 
64   /**
65    * 
66    * @see Lists2#multiMax
67    */
68   @Deprecated
69   public static <T, E extends T> List<E> multiMax(Comparator<T> ordering, Iterable<E> iterable) {
70      return Lists2.<T, E> multiMax(ordering, iterable);
71   }
72 
73   /**
74    * 
75    * @see Throwables2#propagateOrNull
76    */
77   @Deprecated
78   public static <T> T propagateOrNull(Exception from) {
79      return Throwables2.<T> propagateOrNull(from);
80   }
81 
82   /**
83    * 
84    * @see Throwables2#getFirstThrowableOfType(Throwable, Class)
85    */
86   @Deprecated
87   public static <T extends Throwable> T getFirstThrowableOfType(Throwable from, Class<T> clazz) {
88      return Throwables2.<T> getFirstThrowableOfType(from, clazz);
89   }
90 
91   /**
92    * 
93    * @see Throwables2#getFirstThrowableOfType(ProvisionException, Class)
94    */
95   @Deprecated
96   public static <T extends Throwable> T getFirstThrowableOfType(ProvisionException e, Class<T> clazz) {
97      return Throwables2.<T> getFirstThrowableOfType(e, clazz);
98   }
99 
100   /**
101    * 
102    * @see Strings2#replaceTokens
103    */
104   @Deprecated
105   public static String replaceTokens(String value, Iterable<Entry<String, String>> tokenValues) {
106      return Strings2.replaceTokens(value, tokenValues);
107   }
108 
109   /**
110    * 
111    * @see Strings2#replaceAll(String,Pattern, String)
112    */
113   @Deprecated
114   public static String replaceAll(String returnVal, Pattern pattern, String replace) {
115      return Strings2.replaceAll(returnVal, pattern, replace);
116   }
117 
118   /**
119    * 
120    * @see Strings2#replaceAll(String,char,Pattern, String)
121    */
122   @Deprecated
123   public static String replaceAll(String input, char ifMatch, Pattern pattern, String replacement) {
124      return Strings2.replaceAll(input, ifMatch, pattern, replacement);
125   }
126 
127   /**
128    * 
129    * @see Strings2#replaceAll(String,char, String)
130    */
131   @Deprecated
132   public static String replaceAll(String input, char match, String replacement) {
133      return Strings2.replaceAll(input, match, replacement);
134   }
135 
136   /**
137    * 
138    * @see Suppliers2#newOutputStreamSupplier
139    */
140   @Deprecated
141   public static OutputSupplier<OutputStream> newOutputStreamSupplier(final OutputStream output) {
142      return Suppliers2.newOutputStreamSupplier(output);
143   }
144 
145   /**
146    * 
147    * @see Assertions#eventuallyTrue
148    */
149   @Deprecated
150   public static boolean eventuallyTrue(Supplier<Boolean> assertion, long inconsistencyMillis)
151            throws InterruptedException {
152      return Assertions.eventuallyTrue(assertion, inconsistencyMillis);
153   }
154 
155   /**
156    * 
157    * @see Strings2#toStringAndClose
158    */
159   @Deprecated
160   public static String toStringAndClose(InputStream input) throws IOException {
161      return Strings2.toStringAndClose(input);
162   }
163 
164   /**
165    * 
166    * @see Strings2#toInputStream
167    */
168   @Deprecated
169   public static InputStream toInputStream(String in) {
170      return Strings2.toInputStream(in);
171   }
172 
173   /**
174    * 
175    * @see Strings2#encodeString(String, String)
176    */
177   @Deprecated
178   public static byte[] encodeString(String str, String charsetName) {
179      return Strings2.encodeString(str, charsetName);
180   }
181 
182   /**
183    * 
184    * @see Strings2#encodeString(String)
185    */
186   @Deprecated
187   public static byte[] encodeString(String str) {
188      return Strings2.encodeString(str);
189   }
190 
191   /**
192    * 
193    * @see Strings2#replaceTokens(String,Map)
194    */
195   @Deprecated
196   public static String replaceTokens(String input, Map<String, String> replacements) {
197      return Strings2.replaceTokens(input, replacements);
198   }
199 
200   /**
201    * 
202    * @see Preconditions2#checkNotEmpty(String)
203    */
204   @Deprecated
205   public static void checkNotEmpty(String nullableString) {
206      Preconditions2.checkNotEmpty(nullableString);
207   }
208 
209   /**
210    * 
211    * @see Preconditions2#checkNotEmpty(String,String)
212    */
213   @Deprecated
214   public static void checkNotEmpty(String nullableString, String message) {
215      Preconditions2.checkNotEmpty(nullableString, message);
216   }
217 
218   /**
219    * 
220    * @see Providers#getSupportedProviders
221    */
222   @Deprecated
223   public static Iterable<String> getSupportedProviders() {
224      return Providers.getSupportedProviders();
225   }
226 
227   /**
228    * 
229    * @see Providers#getSupportedProvidersOfType
230    */
231   @SuppressWarnings("unchecked")
232   @Deprecated
233   public static Iterable<String> getSupportedProvidersOfType(Class<? extends RestContextBuilder> type) {
234      return Providers.getSupportedProvidersOfType(type);
235   }
236 
237   /**
238    * 
239    * @see Providers#getSupportedProvidersOfTypeInProperties
240    */
241   @SuppressWarnings("unchecked")
242   @Deprecated
243   public static Iterable<String> getSupportedProvidersOfTypeInProperties(
244            final Class<? extends RestContextBuilder<?,?>> type, final Properties properties) {
245      return Providers.getSupportedProvidersOfTypeInProperties(type, properties);
246   }
247 
248   /**
249    * 
250    * @see Providers#resolveContextBuilderClass
251    */
252   @Deprecated
253   public static <S, A> Class<RestContextBuilder<S, A>> resolveContextBuilderClass(String provider,
254            Properties properties) throws ClassNotFoundException, IllegalArgumentException, SecurityException,
255            InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
256      return Providers.<S, A> resolveContextBuilderClass(provider, properties);
257   }
258 
259   /**
260    * 
261    * @see Providers#initContextBuilder
262    */
263   @Deprecated
264   public static <S, A> RestContextBuilder<S, A> initContextBuilder(
265            Class<RestContextBuilder<S, A>> contextBuilderClass, @Nullable Class<S> sync, @Nullable Class<A> async,
266            Properties properties) throws ClassNotFoundException, IllegalArgumentException, SecurityException,
267            InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
268      return Providers.<S, A> initContextBuilder(contextBuilderClass, sync, async, properties);
269   }
270 
271   /**
272    * 
273    * @see Providers#resolvePropertiesBuilderClass
274    */
275   @Deprecated
276   public static Class<PropertiesBuilder> resolvePropertiesBuilderClass(String providerName, Properties props)
277            throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException,
278            NoSuchMethodException {
279      return Providers.resolvePropertiesBuilderClass(providerName, props);
280   }
281 
282   /**
283    * 
284    * @see Modules#modulesForProviderInProperties
285    */
286   @Deprecated
287   public static Iterable<Module> modulesForProviderInProperties(String providerName, Properties props) {
288      return Modules2.modulesForProviderInProperties(providerName, props);
289   }
290 
291   /**
292    * 
293    * @see Modules#modulesFromProperty
294    */
295   @Deprecated
296   public static Iterable<Module> modulesFromProperty(Properties props, String property) {
297      return Modules2.modulesFromProperty(props, property);
298   }
299 
300   /**
301    * 
302    * @see Modules#modulesFromCommaDelimitedString
303    */
304   @Deprecated
305   public static Iterable<Module> modulesFromCommaDelimitedString(String moduleClasses) {
306      return Modules2.modulesFromCommaDelimitedString(moduleClasses);
307   }
308 
309   /**
310    * 
311    * @see CredentialUtils#isPrivateKeyCredential
312    */
313   @Deprecated
314   public static boolean isPrivateKeyCredential(Credentials credentials) {
315      return CredentialUtils.isPrivateKeyCredential(credentials);
316   }
317 
318   /**
319    * 
320    * @see CredentialUtils#overrideCredentialsIfSupplied
321    */
322   @Deprecated
323   public static Credentials overrideCredentialsIfSupplied(Credentials defaultCredentials,
324            @Nullable Credentials overridingCredentials) {
325      return CredentialUtils.overrideCredentialsIfSupplied(defaultCredentials, overridingCredentials);
326   }
327 
328}

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