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 Path
download(URL source, Path target)
static String
getEnv(String key)
static String
getEnv(String key, Supplier<String> fallback)
static int
getNextFreePort(int startPort)
static List<Path>
getPropertyFiles(String fileName)
static String
getSystem()
static void
ignoreException(berlin.yuna.clu.model.ThrowingFunction<Long,Long> function)
static boolean
isNotEmpty(String string)
static boolean
isPortAvailable(int port)
static boolean
isPortInUse(int portNumber)
static String
removeQuotes(String string)
static String
resolveEnvs(String input, Map<NatsConfig,MapValue> config)
static Path
unzip(Path source, Path target)
static void
validatePort(int port, long timeoutMs, boolean untilFree, Supplier<Exception> onFail, BooleanSupplier disrupt)
static boolean
waitForPort(int port, long timeoutMs, boolean isFree)
static boolean
waitForPort(int port, long timeoutMs, boolean isFree, BooleanSupplier disrupt)
-
-
-
Method Detail
-
resolveEnvs
public static String resolveEnvs(String input, Map<NatsConfig,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, BooleanSupplier disrupt) throws Exception
- Throws:
Exception
-
waitForPort
public static boolean waitForPort(int port, long timeoutMs, boolean isFree)
-
waitForPort
public static boolean waitForPort(int port, long timeoutMs, boolean isFree, BooleanSupplier disrupt)
-
isPortAvailable
public static boolean isPortAvailable(int port)
-
getNextFreePort
public static int getNextFreePort(int startPort)
-
isPortInUse
public static boolean isPortInUse(int portNumber)
-
isNotEmpty
public static boolean isNotEmpty(String string)
-
-