Module tvbrowser
Package util.io

Class NetworkUtilities


  • public class NetworkUtilities
    extends java.lang.Object
    Network Helper Class with some utility functions
    Since:
    2.2
    Author:
    bodum
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean checkConnection()
      Checks if a Internet connection can be established
      static boolean checkConnection​(java.net.URL url)
      Checks if a Internet connection to a specific Server can be established
      static boolean checkConnection​(java.net.URL url, int timeout, boolean showWaitingDialog)
      Checks if a Internet connection to a specific Server can be established
      static java.lang.String[] getConnectionCheckUrls()  
      static int getTimeDifferenceSeconds​(java.lang.String serverName)
      get the time difference from a NTP server
      • Methods inherited from class java.lang.Object

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

      • NetworkUtilities

        public NetworkUtilities()
    • Method Detail

      • checkConnection

        public static boolean checkConnection()
        Checks if a Internet connection can be established
        Returns:
        true, if a connection can be established
      • checkConnection

        public static boolean checkConnection​(java.net.URL url)
        Checks if a Internet connection to a specific Server can be established
        Parameters:
        url - check this Server
        Returns:
        true, if a connection can be established
      • checkConnection

        public static boolean checkConnection​(java.net.URL url,
                                              int timeout,
                                              boolean showWaitingDialog)
        Checks if a Internet connection to a specific Server can be established
        Parameters:
        url - check this Server
        timeout - the timeout for the check in milliseconds.
        showWaitingDialog - true if a waiting dialog should be shown, false otherwise.
        Returns:
        true, if a connection can be established
        Since:
        3.4.1
      • getTimeDifferenceSeconds

        public static int getTimeDifferenceSeconds​(java.lang.String serverName)
        get the time difference from a NTP server
        Parameters:
        serverName - The server name
        Returns:
        time difference in seconds
        Since:
        2.6
      • getConnectionCheckUrls

        public static java.lang.String[] getConnectionCheckUrls()