4 import java.io.FileInputStream;
5 import java.io.FileNotFoundException;
6 import java.io.IOException;
7 import java.util.Properties;
9 import jalview.util.ChannelProperties;
11 public class LaunchUtils
14 private static Properties userPreferences = null;
16 public static String getUserPreference(String key)
18 if (userPreferences == null)
20 String channelPrefsFilename = ChannelProperties
21 .getProperty("preferences.filename");
22 String propertiesFile = System.getProperty("user.home")
23 + File.separatorChar + channelPrefsFilename;
26 userPreferences = new Properties();
27 userPreferences.load(new FileInputStream(propertiesFile));
28 } catch (FileNotFoundException e)
30 // didn't find user preferences file
32 } catch (IOException e)
34 System.err.println(e.getMessage());
38 return userPreferences.getProperty(key);