/** * Attempts to load jelly.properties from the current directory, * the users home directory or from the classpath */ protected void loadJellyProperties() { InputStream is = null; String userDir = System.getProperty("user.home"); File f = new File(userDir + File.separator + "jelly.properties"); loadProperties(f); f = new File("jelly.properties"); loadProperties(f); is = ClassLoaderUtils.getClassLoader(getClass()).getResourceAsStream("jelly.properties"); if (is != null) { try { loadProperties(is); } catch (Exception e) { log.error( "Caught exception while loading jelly.properties from the classpath. Reason: " + e, e ); } } }
/** * Attempts to load jelly.properties from the current directory, * the users home directory or from the classpath */ protected void loadJellyProperties() { InputStream is = null; String userDir = System.getProperty("user.home"); File f = new File(userDir + File.separator + "jelly.properties"); loadProperties(f); f = new File("jelly.properties"); loadProperties(f); is = ClassLoaderUtils.getClassLoader(getClass()).getResourceAsStream("jelly.properties"); if (is != null) { try { loadProperties(is); } catch (Exception e) { log.error( "Caught exception while loading jelly.properties from the classpath. Reason: " + e, e ); } } }
/** * Attempts to load jelly.properties from the current directory, * the users home directory or from the classpath */ protected void loadJellyProperties() { InputStream is = null; String userDir = System.getProperty("user.home"); File f = new File(userDir + File.separator + "jelly.properties"); loadProperties(f); f = new File("jelly.properties"); loadProperties(f); is = ClassLoaderUtils.getClassLoader(getClass()).getResourceAsStream("jelly.properties"); if (is != null) { try { loadProperties(is); } catch (Exception e) { log.error( "Caught exception while loading jelly.properties from the classpath. Reason: " + e, e ); } } }
/** * Attempts to load jelly.properties from the current directory, * the users home directory or from the classpath */ protected void loadJellyProperties() { InputStream is = null; String userDir = System.getProperty("user.home"); File f = new File(userDir + File.separator + "jelly.properties"); loadProperties(f); f = new File("jelly.properties"); loadProperties(f); is = ClassLoaderUtils.getClassLoader(getClass()).getResourceAsStream("jelly.properties"); if (is != null) { try { loadProperties(is); } catch (Exception e) { log.error( "Caught exception while loading jelly.properties from the classpath. Reason: " + e, e ); } } }
/** * Load properties from a file into the context * @param f */ private void loadProperties(File f) { InputStream is = null; try { if (f.exists()) { is = new FileInputStream(f); loadProperties(is); } } catch (Exception e) { log.error( "Caught exception while loading: " + f.getName() + ". Reason: " + e, e ); } finally { if (is != null) { try { is.close(); } catch (IOException e) { if (log.isDebugEnabled()) log.debug("error closing property input stream", e); } } } }
/** * Load properties from a file into the context * @param f */ private void loadProperties(File f) { InputStream is = null; try { if (f.exists()) { is = new FileInputStream(f); loadProperties(is); } } catch (Exception e) { log.error( "Caught exception while loading: " + f.getName() + ". Reason: " + e, e ); } finally { if (is != null) { try { is.close(); } catch (IOException e) { if (log.isDebugEnabled()) log.debug("error closing property input stream", e); } } } }
/** * Load properties from a file into the context * @param f */ private void loadProperties(File f) { InputStream is = null; try { if (f.exists()) { is = new FileInputStream(f); loadProperties(is); } } catch (Exception e) { log.error( "Caught exception while loading: " + f.getName() + ". Reason: " + e, e ); } finally { if (is != null) { try { is.close(); } catch (IOException e) { if (log.isDebugEnabled()) log.debug("error closing property input stream", e); } } } }
/** * Load properties from a file into the context * @param f */ private void loadProperties(File f) { InputStream is = null; try { if (f.exists()) { is = new FileInputStream(f); loadProperties(is); } } catch (Exception e) { log.error( "Caught exception while loading: " + f.getName() + ". Reason: " + e, e ); } finally { if (is != null) { try { is.close(); } catch (IOException e) { if (log.isDebugEnabled()) log.debug("error closing property input stream", e); } } } }