Package org.jgroups.protocols.kubernetes
Class Utils
java.lang.Object
org.jgroups.protocols.kubernetes.Utils
- Author:
- Ales Justin
-
Method Summary
Modifier and TypeMethodDescriptionstatic <V> Vstatic <V> Vstatic 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 InputStreamstatic 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) sanitizeHttpHeaders(Map<String, String> headers) Sanitizes a map of HTTP headers - all entries where the key equals "Authorization" (case-insensitive) are overridden to mask the original authorization data.static StringtrimToNull(String s) static String
-
Method Details
-
openStream
public static InputStream openStream(String url, Map<String, String> headers, int connectTimeout, int readTimeout, int attempts, long sleep, StreamProvider streamProvider) throws Exception- Throws:
Exception
-
openFile
- Throws:
FileNotFoundException
-
readFileToString
- Throws:
IOException
-
readFileToString
- Throws:
IOException
-
getSystemProperty
-
getSystemProperty
-
getSystemEnv
-
getSystemEnv
-
getSystemEnv
-
trimToNull
-
urlencode
-
execute
-
execute
public static <V> V execute(Callable<V> callable, int attempts, long sleep, boolean throwOnFail) throws Exception - Throws:
Exception
-
sanitizeHttpHeaders
Sanitizes a map of HTTP headers - all entries where the key equals "Authorization" (case-insensitive) are overridden to mask the original authorization data.- Parameters:
headers- HTTP header map- Returns:
- map where all "Authorization" entries are masked
-