public final class Utils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
close(AutoCloseable cl) |
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 key,
String def) |
static String |
getSystemEnv(String key,
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,
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, StreamProvider streamProvider) throws Exception
Exception
public static final InputStream openFile(String name) throws FileNotFoundException
FileNotFoundException
public static final String readFileToString(String name) throws IOException
IOException
public static final String readFileToString(File file) throws IOException
IOException
public static final String getSystemProperty(String key, String def, boolean trimToNull)
public static final <V> V execute(Callable<V> callable, int attempts, long sleep)
public static final <V> V execute(Callable<V> callable, int attempts, long sleep, boolean throwOnFail) throws Exception
Exception
public static void close(AutoCloseable cl)
Copyright © 2018 JBoss by Red Hat. All rights reserved.