com.google.appengine.tools.info

## Class UpdateCheck

- java.lang.Object
- - 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

    Constructors
    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`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    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`.

    - ### 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,
                             boolean secure)

      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.
        `secure` - if `true`, use an https (instead of http) connection to the remote server.

  - ### 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

          @Deprecated
          public UpdateCheckResults checkForUpdates()

      Deprecated.
      Returns an `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.

    - #### 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

    - #### checkJavaVersion

          public boolean checkJavaVersion(java.io.PrintStream out)