Class NetworkKt

  • All Implemented Interfaces:

    
    public final class NetworkKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final InetAddress getALL_INTERFACES() Internet address used to bind services to all local network interfaces.
      final InetAddress getLOOPBACK_INTERFACE() Internet address used to bind services to the loopback interface.
      final static InetAddress inetAddress(Byte bytes) Syntactic sugar to create an Internet address.
      final static Integer freePort() Return a random free port (not used by any other local process).
      final static Boolean isPortOpened(Integer port) Check if a port is already opened.
      final static URL urlOf(String url)
      final static Integer responseCode(URL $self)
      final static Boolean responseSuccessful(URL $self)
      final static Boolean responseFound(URL $self)
      final static Boolean exists(URL $self)
      final static URL firstVariant(URL $self, String suffixes)
      final static URL localized(URL $self, Locale locale)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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 loopback 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)
      • 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)