Package org.jgroups.protocols.kubernetes
Class Utils
- java.lang.Object
-
- org.jgroups.protocols.kubernetes.Utils
-
public final class Utils extends Object
- Author:
- Ales Justin
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclose(AutoCloseable cl)static <V> Vexecute(Callable<V> callable, int attempts, long sleep)static <V> Vexecute(Callable<V> callable, int attempts, long sleep, boolean throwOnFail)static StringgetSystemEnv(String key)static StringgetSystemEnv(String key, String def)static StringgetSystemEnv(String key, String def, boolean trimToNull)static StringgetSystemProperty(String key, String def)static StringgetSystemProperty(String key, String def, boolean trimToNull)static InputStreamopenFile(String name)static InputStreamopenStream(String url, Map<String,String> headers, int connectTimeout, int readTimeout, int attempts, long sleep, StreamProvider streamProvider)static StringreadFileToString(File file)static StringreadFileToString(String name)static StringtrimToNull(String s)static Stringurlencode(String s)
-
-
-
Method Detail
-
openStream
public static final InputStream openStream(String url, Map<String,String> headers, int connectTimeout, int readTimeout, int attempts, long sleep, StreamProvider streamProvider) throws Exception
- Throws:
Exception
-
openFile
public static final InputStream openFile(String name) throws FileNotFoundException
- Throws:
FileNotFoundException
-
readFileToString
public static final String readFileToString(String name) throws IOException
- Throws:
IOException
-
readFileToString
public static final String readFileToString(File file) throws IOException
- Throws:
IOException
-
getSystemProperty
public static final String getSystemProperty(String key, String def, boolean trimToNull)
-
execute
public static final <V> V execute(Callable<V> callable, int attempts, long sleep)
-
execute
public static final <V> V execute(Callable<V> callable, int attempts, long sleep, boolean throwOnFail) throws Exception
- Throws:
Exception
-
close
public static void close(AutoCloseable cl)
-
-