git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into bug/JAL-4059_update_swingJS_for_JalviewJS_2_11_2_and_2_11_3
[jalview.git]
/
src
/
jalview
/
bin
/
Cache.java
diff --git
a/src/jalview/bin/Cache.java
b/src/jalview/bin/Cache.java
index
9266d2a
..
a64e869
100755
(executable)
--- a/
src/jalview/bin/Cache.java
+++ b/
src/jalview/bin/Cache.java
@@
-54,6
+54,8
@@
import javax.swing.LookAndFeel;
import javax.swing.UIManager;
import jalview.analytics.Plausible;
import javax.swing.UIManager;
import jalview.analytics.Plausible;
+import jalview.bin.argparser.Arg;
+import jalview.bin.argparser.ArgParser;
import jalview.datamodel.PDBEntry;
import jalview.gui.Preferences;
import jalview.gui.UserDefinedColours;
import jalview.datamodel.PDBEntry;
import jalview.gui.Preferences;
import jalview.gui.UserDefinedColours;
@@
-589,7
+591,7
@@
public class Cache
{
if (!Jalview.quiet())
{
{
if (!Jalview.quiet())
{
- jalview.bin.Console.outPrintln(
+ jalview.bin.Console.errPrintln(
"Non-fatal exception when checking version at "
+ remoteBuildPropertiesUrl + ":");
jalview.bin.Console.printStackTrace(ex);
"Non-fatal exception when checking version at "
+ remoteBuildPropertiesUrl + ":");
jalview.bin.Console.printStackTrace(ex);
@@
-792,7
+794,7
@@
public class Cache
} catch (NumberFormatException e)
{
if (!Jalview.quiet())
} catch (NumberFormatException e)
{
if (!Jalview.quiet())
- jalview.bin.Console.outPrintln("Error parsing int property '"
+ jalview.bin.Console.errPrintln("Error parsing int property '"
+ property + "' with value '" + string + "'");
}
}
+ property + "' with value '" + string + "'");
}
}
@@
-811,7
+813,7
@@
public class Cache
} catch (NumberFormatException e)
{
if (!Jalview.quiet())
} catch (NumberFormatException e)
{
if (!Jalview.quiet())
- jalview.bin.Console.outPrintln("Error parsing float property '"
+ jalview.bin.Console.errPrintln("Error parsing float property '"
+ property + "' with value '" + string + "'");
}
}
+ property + "' with value '" + string + "'");
}
}
@@
-862,7
+864,7
@@
public class Cache
} catch (Exception ex)
{
if (!Jalview.quiet())
} catch (Exception ex)
{
if (!Jalview.quiet())
- jalview.bin.Console.outPrintln(
+ jalview.bin.Console.errPrintln(
"Error setting property: " + key + " " + obj + "\n" + ex);
}
return oldValue;
"Error setting property: " + key + " " + obj + "\n" + ex);
}
return oldValue;
@@
-894,7
+896,7
@@
public class Cache
} catch (Exception ex)
{
if (!Jalview.quiet())
} catch (Exception ex)
{
if (!Jalview.quiet())
- jalview.bin.Console.outPrintln("Error saving properties: " + ex);
+ jalview.bin.Console.errPrintln("Error saving properties: " + ex);
}
}
}
}
}
}
@@
-1449,11
+1451,10
@@
public class Cache
if (customProxySet &&
// we have a username but no password for the scheme being
// requested
if (customProxySet &&
// we have a username but no password for the scheme being
// requested
- (protocol.equalsIgnoreCase("http")
- && (httpUser != null
- && httpUser.length() > 0
- && (httpPassword == null
- || httpPassword.length == 0)))
+ (protocol.equalsIgnoreCase("http")
+ && (httpUser != null && httpUser.length() > 0
+ && (httpPassword == null
+ || httpPassword.length == 0)))
|| (protocol.equalsIgnoreCase("https")
&& (httpsUser != null
&& httpsUser.length() > 0
|| (protocol.equalsIgnoreCase("https")
&& (httpsUser != null
&& httpsUser.length() > 0
@@
-1663,27
+1664,36
@@
public class Cache
}
if (file == null || !file.exists())
{
}
if (file == null || !file.exists())
{
+ if (file != null)
+ {
+ jalview.bin.Console
+ .errPrintln("Could not load bootstrap preferences file '"
+ + file.getPath() + "'");
+ }
String channelPrefsFilename = ChannelProperties
.getProperty("preferences.filename");
String propertiesFilename = System.getProperty("user.home")
+ File.separatorChar + channelPrefsFilename;
String channelPrefsFilename = ChannelProperties
.getProperty("preferences.filename");
String propertiesFilename = System.getProperty("user.home")
+ File.separatorChar + channelPrefsFilename;
+ jalview.bin.Console.errPrintln(
+ "Using default properties file '" + propertiesFilename + "'");
file = new File(propertiesFilename);
}
if (file == null || !file.exists())
file = new File(propertiesFilename);
}
if (file == null || !file.exists())
+
{
String releasePrefsFilename = fallbackPropertiesFile;
String releasePropertiesFilename = System.getProperty("user.home")
+ File.separatorChar + releasePrefsFilename;
{
String releasePrefsFilename = fallbackPropertiesFile;
String releasePropertiesFilename = System.getProperty("user.home")
+ File.separatorChar + releasePrefsFilename;
+ jalview.bin.Console.errPrintln("Falling back to properties file '"
+ + releasePropertiesFilename + "'");
file = new File(releasePropertiesFilename);
}
file = new File(releasePropertiesFilename);
}
- if (filename == null)
- return null;
if (!file.exists())
{
jalview.bin.Console
.errPrintln("Could not load bootstrap preferences file '"
if (!file.exists())
{
jalview.bin.Console
.errPrintln("Could not load bootstrap preferences file '"
- + filename + "'");
+ + file.getPath() + "'");
return null;
}
return null;
}
@@
-1723,4
+1733,10
@@
public class Cache
{
return key == null ? null : sessionProperties.get(key);
}
{
return key == null ? null : sessionProperties.get(key);
}
+
+ public static boolean getArgCacheDefault(Arg a, String pref, boolean def)
+ {
+ ArgParser ap = Jalview.getInstance().getArgParser();
+ return ap.isSet(a) ? ap.getBoolean(a) : getDefault(pref, def);
+ }
}
}