Package com.hexagonkt.core
Class NetworkKt
-
- All Implemented Interfaces:
public final class NetworkKt
-
-
Field Summary
Fields Modifier and Type Field Description private final static InetAddressALL_INTERFACESprivate final static InetAddressLOOPBACK_INTERFACE
-
Method Summary
Modifier and Type Method Description final InetAddressgetALL_INTERFACES()Internet address used to bind services to all local network interfaces. final InetAddressgetLOOPBACK_INTERFACE()Internet address used to bind services to the loop-back interface. final static InetAddressinetAddress(Byte bytes)Syntactic sugar to create an Internet address. final static IntegerfreePort()Return a random free port (not used by any other local process). final static BooleanisPortOpened(Integer port)Check if a port is already opened. final static URLurlOf(String url)final static IntegerresponseCode(URL $self)final static BooleanresponseSuccessful(URL $self)final static BooleanresponseFound(URL $self)final static Booleanexists(URL $self)final static URLfirstVariant(URL $self, String suffixes)final static URLlocalized(URL $self, Locale locale)-
-
Method Detail
-
getALL_INTERFACES
final InetAddress getALL_INTERFACES()
Internet address used to bind services to all local network interfaces.
-
getLOOPBACK_INTERFACE
final InetAddress getLOOPBACK_INTERFACE()
Internet address used to bind services to the loop-back interface.
-
inetAddress
final static InetAddress inetAddress(Byte bytes)
Syntactic sugar to create an Internet address.
- Parameters:
bytes- Bytes used in the address.- Returns:
The Internet address corresponding with the supplied bytes.
-
freePort
final static Integer freePort()
Return a random free port (not used by any other local process).
- Returns:
Random free port number.
-
isPortOpened
final static Boolean isPortOpened(Integer port)
Check if a port is already opened.
- Parameters:
port- Port number to check.- Returns:
True if the port is open, false otherwise.
-
urlOf
final static URL urlOf(String url)
-
responseCode
final static Integer responseCode(URL $self)
-
responseSuccessful
final static Boolean responseSuccessful(URL $self)
-
responseFound
final static Boolean responseFound(URL $self)
-
exists
final static Boolean exists(URL $self)
-
firstVariant
final static URL firstVariant(URL $self, String suffixes)
-
localized
final static URL localized(URL $self, Locale locale)
-
-
-
-