X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=getdown%2Fsrc%2Fgetdown%2Fcore%2Fsrc%2Fmain%2Fjava%2Fjalview%2Futil%2FChannelProperties.java;h=40f61106c449663f6f172c1dd08eb76e9884daff;hb=9b8e039f02800dba0f3a3de2bc57e7a8b4f95f1c;hp=cf3b1906c82e0ee5663cff5d69893cad8a47e62a;hpb=7ddd007f23e34c640b720cad6112d1925e67dec8;p=jalview.git diff --git a/getdown/src/getdown/core/src/main/java/jalview/util/ChannelProperties.java b/getdown/src/getdown/core/src/main/java/jalview/util/ChannelProperties.java index cf3b190..40f6110 100644 --- a/getdown/src/getdown/core/src/main/java/jalview/util/ChannelProperties.java +++ b/getdown/src/getdown/core/src/main/java/jalview/util/ChannelProperties.java @@ -1,6 +1,9 @@ package jalview.util; import java.awt.Image; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.net.URL; @@ -122,14 +125,22 @@ public class ChannelProperties } } - public static void loadProps(InputStream is) + protected static void loadProps(File dir) { - try + File channelPropsFile = new File(dir, CHANNEL_PROPERTIES_FILENAME); + if (channelPropsFile.exists()) { - channelProps.load(is); - } catch (IOException e) - { - System.err.println(e.getMessage()); + try + { + InputStream is = new FileInputStream(channelPropsFile); + channelProps.load(is); + } catch (FileNotFoundException e) + { + System.err.println(e.getMessage()); + } catch (IOException e) + { + System.err.println(e.getMessage()); + } } }