|
16 | 16 |
|
17 | 17 | public final class EGEConstants { |
18 | 18 | public static final Properties oxgProps = new Properties(); |
19 | | - String whereami = EGEConstants.class.getProtectionDomain().getCodeSource().getLocation().getPath(); |
20 | | - String PATH = whereami.substring(0, whereami.lastIndexOf(File.separator)); |
| 19 | + static String whereami = EGEConstants.class.getProtectionDomain().getCodeSource().getLocation().getPath(); |
| 20 | + static String PATH = whereami.substring(0, whereami.lastIndexOf(File.separator)); |
21 | 21 | private final static Logger LOGGER = Logger.getLogger(EGEConfigurationManager.class.getName()); |
22 | 22 |
|
23 | 23 | static { |
24 | | - try { |
25 | | - oxgProps.load(new FileInputStream("/etc/oxgarage.properties")); |
26 | | - } |
27 | | - catch (java.io.IOException e) { |
28 | | - LOGGER.error("Could not read file /etc/oxgarage.properties"); |
29 | | - } |
| 24 | + try { |
| 25 | + System.out.println(PATH); |
| 26 | + oxgProps.load(new FileInputStream(PATH + File.separator + "oxgarage.properties")); |
| 27 | + } catch (java.io.IOException e) { |
| 28 | + try { |
| 29 | + oxgProps.load(new FileInputStream(PATH + File.separator + "oxgarage.properties")); |
| 30 | + } catch (java.io.IOException ex) { |
| 31 | + LOGGER.error("Could not read file /etc/oxgarage.properties or " + PATH |
| 32 | + + File.separator + "oxgarage.properties" ); |
| 33 | + } |
| 34 | + } |
| 35 | + |
30 | 36 | } |
31 | 37 |
|
32 | 38 |
|
33 | 39 | /** |
34 | 40 | * EGE temporary files directory |
35 | 41 | */ |
36 | | - public static final String OXGAPP = oxgProps.getProperty("OXGARAGE","/var/cache/oxgarage/"); |
37 | | - public static final String TEIROOT = oxgProps.getProperty("TEI","/usr/share/xml/tei/"); |
38 | | - public static final String OpenOfficeConfig = oxgProps.getProperty("OpenOfficeConfig","/usr/lib/libreoffice/"); |
39 | | - public static final String DEFAULT_LOCALE = oxgProps.getProperty("defaultLocale","en"); |
40 | | - public static final String DEFAULT_PROFILE = oxgProps.getProperty("defaultProfile","default"); |
| 42 | + public static final String OXGAPP = oxgProps.getProperty("OXGARAGE","/var/cache/oxgarage/"); |
| 43 | + public static final String TEIROOT = oxgProps.getProperty("TEI","/usr/share/xml/tei/"); |
| 44 | + public static final String OpenOfficeConfig = oxgProps.getProperty("OpenOfficeConfig","/usr/lib/libreoffice/"); |
| 45 | + public static final String DEFAULT_LOCALE = oxgProps.getProperty("defaultLocale","en"); |
| 46 | + public static final String DEFAULT_PROFILE = oxgProps.getProperty("defaultProfile","default"); |
41 | 47 | // name for document family consisting of text documents |
42 | 48 | public static final String TEXTFAMILY = "Documents"; |
43 | 49 | public static final String TEXTFAMILYCODE = "text"; |
|
0 commit comments