public class PortChecker
extends java.lang.Object
Constructor and Description |
---|
PortChecker(int portSearchStart)
Instantiates a new port checker.
|
PortChecker(int portSearchStart,
java.lang.String checkURLorIP)
Instantiates a new port checker.
|
Modifier and Type | Method and Description |
---|---|
int |
getFreePort()
Provides the next free port number.
|
boolean |
isFreePort(int port)
Checks if a port is available (free).
|
boolean |
isFreePortHTTP(int port,
java.lang.String checkURLorIP)
Checks if a free http was specified.
|
public PortChecker(int portSearchStart)
portSearchStart
- the port search startpublic PortChecker(int portSearchStart, java.lang.String checkURLorIP)
portSearchStart
- the port search startcheckURLorIP
- the URL or the IP to checkpublic int getFreePort()
public boolean isFreePort(int port)
port
- the portpublic boolean isFreePortHTTP(int port, java.lang.String checkURLorIP)
port
- the portcheckURLorIP
- the HTTP or HTTPS address