Package berlin.yuna.natsserver.logic
Class NatsUtils
java.lang.Object
berlin.yuna.natsserver.logic.NatsUtils
-
Method Summary
Modifier and TypeMethodDescriptioncreatePathSuppliers(String pathString) static Pathstatic Stringstatic Stringstatic intgetNextFreePort(int startPort) static Stringstatic voidignoreException(berlin.yuna.clu.model.ThrowingFunction<Long, Long> function) static booleanstatic booleanisPortAvailable(int port) static booleanisPortInUse(int portNumber) static StringremoveQuotes(String string) static StringresolveEnvs(String input, Map<NatsConfig, MapValue> config) static Pathstatic voidvalidatePort(int port, long timeoutMs, boolean untilFree, Supplier<Exception> onFail) static booleanwaitForPort(int port, long timeoutMs, boolean isFree)
-
Method Details
-
getEnv
-
getEnv
-
resolveEnvs
-
getSystem
-
download
-
unzip
- 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
-
removeQuotes
-
createPathSuppliers
-
ignoreException
-