-package jalview.bin;
+package jalview.util;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
-import jalview.util.ChannelProperties;
-
public class LaunchUtils
{
+ public static void loadChannelProps(File dir)
+ {
+ ChannelProperties.loadProps(dir);
+ }
+
private static Properties userPreferences = null;
public static String getUserPreference(String key)
{
String channelPrefsFilename = ChannelProperties
.getProperty("preferences.filename");
- String propertiesFile = System.getProperty("user.home")
- + File.separatorChar + channelPrefsFilename;
+ if (channelPrefsFilename == null)
+ {
+ return null;
+ }
+ File propertiesFile = new File(System.getProperty("user.home"),
+ channelPrefsFilename);
+ if (!propertiesFile.exists())
+ {
+ return null;
+ }
try
{
userPreferences = new Properties();
return userPreferences.getProperty(key);
}
+ public static boolean getBooleanUserPreference(String key)
+ {
+ return Boolean.parseBoolean(getUserPreference(key));
+ }
}