Package edu.wisc.game.util
Class Hosts
java.lang.Object
edu.wisc.game.util.Hosts
public class Hosts extends Object
Convenience routines to determine the host name etc
-
Constructor Summary
Constructors Constructor Description Hosts()
-
Method Summary
Modifier and Type Method Description static boolean
atHome()
Returns true if the application apparently runs on a home PCstatic String
determineHostname()
Returns the host name this application is running on.static boolean
isLocal(String hostname)
Returns true if this is a test run on a home PC.
-
Constructor Details
-
Hosts
public Hosts()
-
-
Method Details
-
isLocal
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
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
-