| 58 | | // 2. load user defaults |
| 59 | | InputStream in = PropertiesLoader.class.getResourceAsStream("/fckeditor.properties"); |
| 60 | | if (in == null) |
| 61 | | logger.warn("Can't find fckeditor.properties!"); |
| 62 | | else { |
| 63 | | try { |
| 64 | | properties.load(new BufferedInputStream(in)); |
| 65 | | logger.info("fckeditor.properties loaded successfully!"); |
| 66 | | } catch (IOException e) { |
| 67 | | logger.error("Error while loading fckeditor.properties!", e); |
| 68 | | throw new RuntimeException("Can't load fckeditor.properties!", e); |
| 69 | | } |
| | 53 | // 1. load library defaults |
| | 54 | InputStream in = PropertiesLoader.class |
| | 55 | .getResourceAsStream("default.properties"); |
| | 56 | |
| | 57 | if (in == null) { |
| | 58 | logger.error("default.properties not found"); |
| | 59 | throw new RuntimeException("default.properties not found"); |
| | 60 | } else { |
| | 61 | if (!(in instanceof BufferedInputStream)) |
| | 62 | in = new BufferedInputStream(in); |
| | 63 | |
| | 64 | try { |
| | 65 | properties.load(in); |
| | 66 | in.close(); |
| | 67 | logger.debug("default.properties loaded"); |
| | 68 | } catch (Exception e) { |
| | 69 | logger.error("Error while processing default.properties"); |
| | 70 | throw new RuntimeException( |
| | 71 | "Error while processing default.properties", e); |
| | 74 | |
| | 75 | // 2. load user defaults |
| | 76 | InputStream in2 = PropertiesLoader.class |
| | 77 | .getResourceAsStream("/fckeditor.properties_"); |
| | 78 | |
| | 79 | if (in2 == null) { |
| | 80 | logger.info("fckeditor.properties not found"); |
| | 81 | } else { |
| | 82 | |
| | 83 | if (!(in2 instanceof BufferedInputStream)) |
| | 84 | in2 = new BufferedInputStream(in2); |
| | 85 | |
| | 86 | try { |
| | 87 | properties.load(in2); |
| | 88 | in2.close(); |
| | 89 | logger.debug("fckeditor.properties loaded"); |
| | 90 | } catch (Exception e) { |
| | 91 | logger.error("Error while processing fckeditor.properties"); |
| | 92 | throw new RuntimeException( |
| | 93 | "Error while processing fckeditor.properties", e); |
| | 94 | } |
| | 95 | |
| | 96 | } |