*/
public static Logger log;
+ // save the proxy properties set at startup
+ public final static String[] startupProxyProperties = {
+ System.getProperty("http.proxyHost"),
+ System.getProperty("http.proxyPort"),
+ System.getProperty("https.proxyHost"),
+ System.getProperty("https.proxyPort"),
+ System.getProperty("http.proxyUser"),
+ System.getProperty("http.proxyPassword"),
+ System.getProperty("https.proxyUser"),
+ System.getProperty("https.proxyPassword"),
+ System.getProperty("http.nonProxyHosts") };
+
+ public final static String PROXYTYPE_NONE = "none";
+
+ // "false" and "true" for backward compatibility
+ public final static String PROXYTYPE_SYSTEM = "false";
+
+ public final static String PROXYTYPE_CUSTOM = "true";
+
+ // in-memory only storage of proxy password, safer to use char array
+ public static char[] proxyAuthPassword = null;
-
/** Jalview Properties */
private Properties applicationProperties = new Properties()
{
}
};
+ /* build Properties (not all saved to .jalview_properties) */
+ public static Properties buildProperties = new Properties();
-
/** Default file is ~/.jalview_properties */
static String propertiesFile;
// lcastor.setLevel(Level.toLevel(Cache.getDefault("logs.Castor.Level",
// Level.INFO.toString())));
// we shouldn't need to do this
- org.apache.log4j.Logger.getRootLogger()
- .setLevel(org.apache.log4j.Level.INFO);
-
+ org.apache.log4j.Logger.getRootLogger().setLevel(org.apache.log4j.Level.INFO);
-
jalview.bin.Cache.log.setLevel(Level.toLevel(Cache
.getDefault("logs.Jalview.level", Level.INFO.toString())));
// laxis.addAppender(ap);
System.out.println("Error reading properties file: " + ex);
}
}
-
+ /* TO BE REPLACED WITH PROXY_TYPE SETTINGS
if (getDefault("USE_PROXY", false))
{
String proxyServer = getDefault("PROXY_SERVER", ""),
&& (System.getProperty("java.awt.headless") == null || System
.getProperty("java.awt.headless").equals("false")))
{
-
- new Thread()
+ class VersionChecker extends Thread
{
@Override
public void run()
{
+ String remoteBuildPropertiesUrl = Cache
+ .getAppbaseBuildProperties();
-
String orgtimeout = System
.getProperty("sun.net.client.defaultConnectTimeout");
if (orgtimeout == null)
{
System.setProperty("sun.net.client.defaultConnectTimeout",
"5000");
- java.net.URL url = new java.net.URL(Cache
- .getDefault("www.jalview.org", "http://www.jalview.org")
- + "/webstart/jalview.jnlp");
+ java.net.URL url = new java.net.URL(remoteBuildPropertiesUrl);
-
BufferedReader in = new BufferedReader(
new InputStreamReader(url.openStream()));
- String line = null;
- while ((line = in.readLine()) != null)
- {
- if (line.indexOf("jalview.version") == -1)
- {
- continue;
- }
- line = line.substring(line.indexOf("value=") + 7);
- line = line.substring(0, line.lastIndexOf("\""));
- remoteVersion = line;
- break;
- }
+ Properties remoteBuildProperties = new Properties();
+ remoteBuildProperties.load(in);
+ remoteVersion = remoteBuildProperties.getProperty("VERSION");
} catch (Exception ex)
{
- System.out.println(
- "Non-fatal exception when checking version at www.jalview.org :");
+ System.out
+ .println("Non-fatal exception when checking version at "
+ + remoteBuildPropertiesUrl + ":");
System.out.println(ex);
remoteVersion = getProperty("VERSION");
}