com.google.appengine.tools.info
Class UpdateCheck

java.lang.Object
  extended by com.google.appengine.tools.info.UpdateCheck

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 Summary
UpdateCheck(java.lang.String server)
          Create a new UpdateCheck.
UpdateCheck(java.lang.String server, java.io.File appDirectory)
          Create a new UpdateCheck.
 
Method Summary
 boolean allowedToCheckForUpdates()
          Returns true if the user wants to check for updates even when we don't need to.
 UpdateCheckResults checkForUpdates()
          Check to see if there is a new version of the SDK available and return a UpdateCheckResults summarizing the results.
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdateCheck

public UpdateCheck(java.lang.String server)
Create a new UpdateCheck.

Parameters:
server - The remote server to connect to when retrieving remote version information.

UpdateCheck

public UpdateCheck(java.lang.String server,
                   java.io.File appDirectory)
Create a new UpdateCheck.

Parameters:
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.
Method Detail

allowedToCheckForUpdates

public boolean allowedToCheckForUpdates()
Returns true if the user wants to check for updates even when we don't need to. We assume that users will want this functionality, but they can opt out by creating an .appcfg_no_nag file in their home directory.


checkForUpdates

public UpdateCheckResults checkForUpdates()
Check to see if there is a new version of the SDK available and return a UpdateCheckResults summarizing the results.

Callers that do not already communicate with Google explicitly (e.g. the DevAppServer) should check allowedToCheckForUpdates before calling this method.


maybePrintNagScreen

public 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. 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.

Returns:
true if a nag screen was printed, false otherwise