public class UpdateCheck
extends java.lang.Object
UpdateCheck
is responsible for gathering version
information about the local SDK, uploading this information to
Google's servers in exchange for information about the latest
version available, and making both sets of information available
programmatically via UpdateCheckResults
and for direct user
consumption via a nag screen printed to a specified PrintStream
.Constructor and Description |
---|
UpdateCheck(java.lang.String server)
Create a new
UpdateCheck . |
UpdateCheck(java.lang.String server,
java.io.File appDirectory,
boolean secure)
Create a new
UpdateCheck . |
Modifier and Type | Method and Description |
---|---|
boolean |
allowedToCheckForUpdates()
Returns true if the user wants to check for updates even when we
don't need to.
|
UpdateCheckResults |
checkForUpdates()
Deprecated.
|
boolean |
checkJavaVersion(java.io.PrintStream out) |
boolean |
maybePrintNagScreen(java.io.PrintStream out)
Check to see if there is a new version of the SDK available and,
if sufficient time has passed since the last nag, print a nag
screen to
out . |
public UpdateCheck(java.lang.String server)
UpdateCheck
.server
- The remote server to connect to when retrieving
remote version information.public UpdateCheck(java.lang.String server, java.io.File appDirectory, boolean secure)
UpdateCheck
.server
- The remote server to connect to when retrieving
remote version information.appDirectory
- The application directory that you plan to
test or publish, or null
if no application directory is
available.secure
- if true
, use an https (instead of http)
connection to the remote server.public boolean allowedToCheckForUpdates()
@Deprecated public UpdateCheckResults checkForUpdates()
UpdateCheckResults
for checking if a WAR
directory or the local installation uses an out of date version
of the SDK.
Callers that do not already communicate with Google explicitly
(e.g. the DevAppServer) should check allowedToCheckForUpdates
before calling this method.
public boolean maybePrintNagScreen(java.io.PrintStream out)
out
. This method always errs on the side of
not nagging the user if errors are encountered.
Callers that do not already communicate with Google explicitly
(e.g. the DevAppServer) should check allowedToCheckForUpdates
before calling this method.
public boolean checkJavaVersion(java.io.PrintStream out)