@Override
public void run()
{
- String buildPropertiesUrl = Cache.getAppbaseBuildProperties();
+ String remoteBuildPropertiesUrl = Cache
+ .getAppbaseBuildProperties();
String orgtimeout = System
.getProperty("sun.net.client.defaultConnectTimeout");
{
System.setProperty("sun.net.client.defaultConnectTimeout",
"5000");
- java.net.URL url = new java.net.URL(buildPropertiesUrl);
+ java.net.URL url = new java.net.URL(remoteBuildPropertiesUrl);
BufferedReader in = new BufferedReader(
new InputStreamReader(url.openStream()));
{
System.out
.println("Non-fatal exception when checking version at "
- + buildPropertiesUrl + ":");
+ + remoteBuildPropertiesUrl + ":");
System.out.println(ex);
remoteVersion = getProperty("VERSION");
}
InputStream in = localJarFileURL.openStream();
buildProperties.load(in);
in.close();
- applicationProperties.put("BUILD_DATE",
- buildProperties.get("BUILD_DATE"));
- applicationProperties.put("INSTALLATION",
- buildProperties.get("INSTALLATION"));
- applicationProperties.put("VERSION", buildProperties.get("VERSION"));
+ if (buildProperties.getProperty("BUILD_DATE", null) != null)
+ {
+ applicationProperties.put("BUILD_DATE",
+ buildProperties.getProperty("BUILD_DATE"));
+ }
+ if (buildProperties.getProperty("INSTALLATION", null) != null)
+ {
+ applicationProperties.put("INSTALLATION",
+ buildProperties.getProperty("INSTALLATION"));
+ }
+ if (buildProperties.getProperty("VERSION", null) != null)
+ {
+ applicationProperties.put("VERSION",
+ buildProperties.getProperty("VERSION"));
+ }
} catch (Exception ex)
{
System.out.println("Error reading build details: " + ex);
static
{
- Float specversion = Float
- .parseFloat(System.getProperty("java.specification.version"));
- releaseAppbase = (specversion < 9)
- ? "https://www.jalview.org/getdown/release/1.8"
- : "https://www.jalview.org/getdown/release/11";
+ if (!Platform.isJS())
+ {
+ Float specversion = Float
+ .parseFloat(System.getProperty("java.specification.version"));
+ releaseAppbase = (specversion < 9)
+ ? "https://www.jalview.org/getdown/release/1.8"
+ : "https://www.jalview.org/getdown/release/11";
+ }
+ else
+ {
+ // this value currenly made up, can be changed to URL that will be
+ // "https://www.jalview.org/jalview-js/swingjs/j2s/build_properties"
+ releaseAppbase = "https://www.jalview.org/jalview-js";
+ getdownAppbase = releaseAppbase;
+ getdownDistDir = "/swingjs/j2s";
+ }
}
// look for properties (passed in by getdown) otherwise default to release