public class GeneralUtils extends Object
Modifier and Type | Field | Description |
---|---|---|
protected static String |
standardConfig |
Properties resource containing standard configuration @see #loadConfig
|
Constructor | Description |
---|---|
GeneralUtils() |
Modifier and Type | Method | Description |
---|---|---|
static Properties |
getConfig() |
Returns default properties @see #loadConfig
|
static String |
getSystemProperty(String name) |
Retrieve system property safely.
|
static String |
getUserAgentString() |
Return jGridstart's user-agent string.
|
static String |
getUserAgentString(String middle) |
Return jGridstart's user-agent string with intermediate portion.
|
static String |
getUserAgentStringWithoutJava() |
Same as
getUserAgentString() but without Java |
static String |
getVersionString() |
Return jGridstart's version string
|
static void |
loadConfig() |
Loads standard system properties from configuration.
|
protected static final String standardConfig
public static void loadConfig() throws IOException
Reads the standard configuration properties into the System property store. Doesn't overwrite existing properties, so that they can be overridden from the command-line.
In addition to this, all properties that have a name starting with jnlp.jgridstart.<x> or javaws.jgridstart.<x> are renamed to jgridstart.<x> before the standard configuration is read. This allows one to modify jgridstart properties in the jnlp file without requiring to sign it.
IOException
public static Properties getConfig() throws IOException
IOException
public static String getSystemProperty(String name)
This method doesn't throw an exception when the value cannot be accessed, but returns "<protected>" instead.
public static String getVersionString()
public static String getUserAgentString()
This string is a complete user-agent string, described by http://www-archive.mozilla.org/build/revised-user-agent-strings.html, although the OS/CPU value is not strictly translated to Mozilla's conventions.
Added to the comment (the stuff between brackets) is the CA implementation.
Example output: jGridstart/1.1_1234 (X11; I; Linux amd64; TestCA) Java/1.6.0
public static String getUserAgentString(String middle)
This is useful for setting the user-agent of http client libraries so that the full stack of libraries is shown.
getUserAgentString()
public static String getUserAgentStringWithoutJava()
getUserAgentString()
but without JavagetUserAgentString()
Copyright © 2010-2018 Nikhef / Stichting FOM. All Rights Reserved.