public class UpdateChecker
extends java.util.TimerTask
Modifier and Type | Field and Description |
---|---|
private static int |
CONNECT_TIMEOUT |
private static org.slf4j.Logger |
LOG |
private static long |
MILLIS_PER_SECOND |
private static long |
START_TIME |
private static java.lang.String |
UNKNOWN |
private static java.lang.String |
UPDATE_CHECK_URL |
Constructor and Description |
---|
UpdateChecker() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
buildParamsString()
construct update url parameters
|
private java.net.URL |
buildUpdateCheckUrl() |
void |
checkForUpdate()
This method ensures that there will be no exception thrown.
|
private void |
doCheck() |
private int |
getClientId() |
private java.lang.String |
getProperty(java.lang.String prop) |
private java.util.Properties |
getUpdateProperties(java.net.URL updateUrl) |
private long |
getUptimeInSeconds() |
private boolean |
notBlank(java.lang.String s) |
void |
run()
Run the update check
|
protected java.lang.String |
urlEncode(java.lang.String param)
URL safe encoding
|
private static final org.slf4j.Logger LOG
private static final long MILLIS_PER_SECOND
private static final int CONNECT_TIMEOUT
private static final java.lang.String UNKNOWN
private static final java.lang.String UPDATE_CHECK_URL
private static final long START_TIME
public void run()
run
in interface java.lang.Runnable
run
in class java.util.TimerTask
public void checkForUpdate()
private void doCheck() throws java.io.IOException
java.io.IOException
private java.util.Properties getUpdateProperties(java.net.URL updateUrl) throws java.io.IOException
java.io.IOException
private java.net.URL buildUpdateCheckUrl() throws java.net.MalformedURLException, java.io.UnsupportedEncodingException
java.net.MalformedURLException
java.io.UnsupportedEncodingException
protected java.lang.String buildParamsString() throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
private long getUptimeInSeconds()
private int getClientId()
protected java.lang.String urlEncode(java.lang.String param) throws java.io.UnsupportedEncodingException
param
- java.io.UnsupportedEncodingException
private java.lang.String getProperty(java.lang.String prop)
private boolean notBlank(java.lang.String s)