public final class Utils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <V> V |
execute(Callable<V> callable,
int attempts,
long sleep) |
static <V> V |
execute(Callable<V> callable,
int attempts,
long sleep,
boolean throwOnFail) |
static String |
getSystemEnv(String key) |
static String |
getSystemEnv(String[] keys,
String def,
boolean trimToNull) |
static String |
getSystemEnv(String key,
String def) |
static String |
getSystemEnv(String key,
String def,
boolean trimToNull) |
static int |
getSystemEnvInt(String key) |
static int |
getSystemEnvInt(String[] keys,
int def) |
static int |
getSystemEnvInt(String key,
int def) |
static String |
getSystemProperty(String key) |
static String |
getSystemProperty(String[] keys,
String def,
boolean trimToNull) |
static String |
getSystemProperty(String key,
String def) |
static String |
getSystemProperty(String key,
String def,
boolean trimToNull) |
static InputStream |
openFile(String name) |
static InputStream |
openStream(String url,
Map<String,String> headers,
int connectTimeout,
int readTimeout,
int attempts,
long sleep) |
static InputStream |
openStream(String url,
Map<String,String> headers,
int connectTimeout,
int readTimeout,
int attempts,
long sleep,
StreamProvider streamProvider) |
static String |
readFileToString(File file) |
static String |
readFileToString(String name) |
static String |
trimToNull(String s) |
static String |
urlencode(String s) |
public static final InputStream openStream(String url, Map<String,String> headers, int connectTimeout, int readTimeout, int attempts, long sleep) throws Exception
Exceptionpublic static final InputStream openStream(String url, Map<String,String> headers, int connectTimeout, int readTimeout, int attempts, long sleep, StreamProvider streamProvider) throws Exception
Exceptionpublic static final InputStream openFile(String name) throws FileNotFoundException
FileNotFoundExceptionpublic static final String readFileToString(String name) throws IOException
IOExceptionpublic static final String readFileToString(File file) throws IOException
IOExceptionpublic static final String getSystemProperty(String key, String def, boolean trimToNull)
public static final String getSystemProperty(String[] keys, String def, boolean trimToNull)
public static final int getSystemEnvInt(String key)
public static final int getSystemEnvInt(String key, int def)
public static final int getSystemEnvInt(String[] keys, int def)
public static final <V> V execute(Callable<V> callable, int attempts, long sleep)
Copyright © 2017 JBoss by Red Hat. All rights reserved.