X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FCache.java;h=a64e86994d8cfa35add4fd6eb44fb9f4d518913e;hb=ccc53e88e3260886f5d3bdacc619c0f374be9b8f;hp=1abb1711df86e47d18ffdbd1dbc8dd27a4e7fdcc;hpb=e282451a1f29b46bdf9cf6489081e68f1deaade8;p=jalview.git diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 1abb171..a64e869 100755 --- 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 jalview.bin.argparser.Arg; +import jalview.bin.argparser.ArgParser; import jalview.datamodel.PDBEntry; import jalview.gui.Preferences; import jalview.gui.UserDefinedColours; @@ -1449,11 +1451,10 @@ public class Cache 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 @@ -1663,27 +1664,36 @@ public class Cache } 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; + jalview.bin.Console.errPrintln( + "Using default properties file '" + propertiesFilename + "'"); file = new File(propertiesFilename); } if (file == null || !file.exists()) + { 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); } - if (filename == null) - return null; if (!file.exists()) { jalview.bin.Console .errPrintln("Could not load bootstrap preferences file '" - + filename + "'"); + + file.getPath() + "'"); return null; } @@ -1723,4 +1733,10 @@ public class Cache { 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); + } }