Class Hosts

java.lang.Object
edu.wisc.game.util.Hosts

public class Hosts
extends Object
Convenience routines to determine the host name etc
  • Constructor Details

  • Method Details

    • isLocal

      public static boolean isLocal​(String hostname)
      Returns true if this is a test run on a home PC. The list of such machines' host names is hard-coded inside this method. When such a machine is used, we can use the "localhost" URL in emails, since the emails will most likely be read in a web browser on the same machine, possibly even in off-line mode. This contrasts with production runs on a "real" web server, when the true hostname should always be used.
    • determineHostname

      public static String determineHostname()
      Returns the host name this application is running on.
    • atHome

      public static boolean atHome()
      Returns true if the application apparently runs on a home PC