Package berlin.yuna.natsserver.logic
Class NatsUtils
- java.lang.Object
-
- berlin.yuna.natsserver.logic.NatsUtils
-
public class NatsUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Pathdownload(URL source, Path target)static StringgetEnv(String key)static StringgetEnv(String key, Supplier<String> fallback)static intgetNextFreePort(int startPort)static StringgetSystem()static booleanisEmpty(String string)static booleanisPortAvailable(int port)static booleanisPortInUse(int portNumber)static StringremoveQuotes(String string)static StringresolveEnvs(String input, Map<NatsStreamingConfig,MapValue> config)static Pathunzip(Path source, Path target)static voidvalidatePort(int port, long timeoutMs, boolean untilFree, Supplier<Exception> onFail)static booleanwaitForPort(int port, long timeoutMs, boolean isFree)
-
-
-
Method Detail
-
resolveEnvs
public static String resolveEnvs(String input, Map<NatsStreamingConfig,MapValue> config)
-
getSystem
public static String getSystem()
-
unzip
public static Path unzip(Path source, Path target) throws IOException
- Throws:
IOException
-
validatePort
public static void validatePort(int port, long timeoutMs, boolean untilFree, Supplier<Exception> onFail) throws Exception- Throws:
Exception
-
waitForPort
public static boolean waitForPort(int port, long timeoutMs, boolean isFree)
-
isPortAvailable
public static boolean isPortAvailable(int port)
-
getNextFreePort
public static int getNextFreePort(int startPort)
-
isPortInUse
public static boolean isPortInUse(int portNumber)
-
isEmpty
public static boolean isEmpty(String string)
-
-