- java.lang.Object
-
- util.io.NetworkUtilities
-
public class NetworkUtilities extends java.lang.Object
Network Helper Class with some utility functions- Since:
- 2.2
- Author:
- bodum
-
-
Constructor Summary
Constructors Constructor Description NetworkUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
checkConnection()
Checks if a Internet connection can be establishedstatic boolean
checkConnection(java.net.URL url)
Checks if a Internet connection to a specific Server can be establishedstatic boolean
checkConnection(java.net.URL url, int timeout, boolean showWaitingDialog)
Checks if a Internet connection to a specific Server can be establishedstatic java.lang.String[]
getConnectionCheckUrls()
static int
getTimeDifferenceSeconds(java.lang.String serverName)
get the time difference from a NTP server
-
-
-
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 Servertimeout
- 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()
-
-