Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
-
|
|
|
132 | 132 | { |
133 | 133 | Properties config = new Properties(); |
134 | 134 | try { |
135 | | FileInputStream fis = new FileInputStream(file); |
136 | | config.load(fis); |
| 135 | config.load(org.openmicroscopy.shoola.util.file.IOUtil.readConfigFile(file)); |
137 | 136 | } catch (Exception e) { |
138 | 137 | return null; |
139 | 138 | } |
-
|
|
|
130 | 130 | { |
131 | 131 | InputStream stream; |
132 | 132 | try { |
133 | | stream = new FileInputStream(file); |
| 133 | stream = org.openmicroscopy.shoola.util.file.IOUtil.readConfigFile(file); |
134 | 134 | } catch (Exception e) { |
135 | 135 | return null; |
136 | 136 | } |
-
|
|
|
154 | 154 | DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); |
155 | 155 | try { |
156 | 156 | DocumentBuilder builder = factory.newDocumentBuilder(); |
157 | | document = builder.parse(new File(configFile)); |
| 157 | document = builder.parse(org.openmicroscopy.shoola.util.file.IOUtil.readConfigFile(configFile)); |
158 | 158 | if (validating) { |
159 | 159 | factory.setValidating(true); |
160 | 160 | factory.setNamespaceAware(true); |
-
|
|
|
130 | 130 | private static Properties loadConfig(String file) |
131 | 131 | { |
132 | 132 | Properties config = new Properties(); |
133 | | FileInputStream fis = null; |
134 | | try { |
135 | | fis = new FileInputStream(file); |
| 133 | java.io.InputStream fis = null; |
| 134 | try { |
| 135 | fis = org.openmicroscopy.shoola.util.file.IOUtil.readConfigFile(file); |
136 | 136 | config.load(fis); |
137 | 137 | } catch (Exception e) { |
138 | 138 | return null; |
-
|
|
|
162 | 162 | { |
163 | 163 | String message; |
164 | 164 | try { |
165 | | FileInputStream fis = new FileInputStream(file); |
| 165 | java.io.InputStream fis = org.openmicroscopy.shoola.util.file.IOUtil.readConfigFile(file); |
166 | 166 | BufferedReader in = new BufferedReader(new InputStreamReader(fis)); |
167 | 167 | StringBuffer buffer = new StringBuffer(); |
168 | 168 | int number = 0; |
-
|
|
|
144 | 144 | return readTextFile(new File(fileName)); |
145 | 145 | } |
146 | 146 | |
| 147 | public static InputStream readConfigFile(String file) throws IOException { |
| 148 | try { |
| 149 | return System.getProperty("javawebstart.version", null) != null ? Class.forName("uk.ac.imperial.cisbic.Config").getClassLoader().getResourceAsStream(new java.io.File(file).getName()) : new FileInputStream(file); |
| 150 | } catch (ClassNotFoundException e) { |
| 151 | throw new RuntimeException(e); |
| 152 | } |
| 153 | } |
147 | 154 | } |
Download in other formats:
1.3.13-PRO © 2008-2011
Agilo Software all
rights reserved
(this page was served in: 0.21690 sec.)