![JAR search and dependency download from the Maven repository](/logo.png)
io.timson.firehose.util.FirehoseUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of firehose-mock Show documentation
Show all versions of firehose-mock Show documentation
An embedded Java mock for AWS Kinesis Firehose
package io.timson.firehose.util;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.net.ServerSocket;
public class FirehoseUtil {
public static Integer randomFreePort() {
try (ServerSocket socket = new ServerSocket(0)) {
return socket.getLocalPort();
} catch (IOException e) {
throw new UncheckedIOException("Unable to find a free port", e);
}
}
public static boolean isEmpty(String str) {
return (str == null || str.equals(""));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy