public ReloadableProperties load(String nameProperty, String fallbackName, Map options) { ReloadableProperties result; FileNameKey key = new FileNameKey(nameProperty, fallbackName, options); key.setDebug(debug); synchronized (staticCache) { result = staticCache.get(key); if (result == null) { result = new ReloadableProperties(key); staticCache.put(key, result); } } return result.obtained(); }
public FileNameKey(String nameProperty, String fallbackName, Map options) { this.file = new File(baseDir(options), stringOption(nameProperty, fallbackName, options)); absPath = file.getAbsolutePath(); reload = booleanOption("reload", options); decrypt = booleanOption("decrypt", options); }
public synchronized ReloadableProperties obtained() { if (reloadTime < 0 || (key.isReload() && hasModificationAfter(reloadTime))) { props = new Properties(); try { load(key.file(), props); invertedProps = null; invertedValueProps = null; if (key.isDebug()) { LOG.debug("Load of: " + key); } } catch (IOException e) { LOG.error("Failed to load: " + key + ", reason:" + e.getLocalizedMessage()); if (key.isDebug()) { LOG.debug("Load of: " + key + ", failure exception" + e); } } reloadTime = System.currentTimeMillis(); } return this; }
public synchronized ReloadableProperties obtained() { if (reloadTime < 0 || (key.isReload() && hasModificationAfter(reloadTime))) { props = new Properties(); try { load(key.file(), props); invertedProps = null; invertedValueProps = null; if (key.isDebug()) { LOG.debug("Load of: " + key); } } catch (IOException e) { LOG.error("Failed to load: " + key + ", reason:" + e.getLocalizedMessage()); if (key.isDebug()) { LOG.debug("Load of: " + key + ", failure exception" + e); } } reloadTime = System.currentTimeMillis(); } return this; }
public synchronized ReloadableProperties obtained() { if (reloadTime < 0 || (key.isReload() && hasModificationAfter(reloadTime))) { props = new Properties(); try { load(key.file(), props); invertedProps = null; invertedValueProps = null; if (key.isDebug()) { LOG.debug("Load of: " + key); } } catch (IOException e) { LOG.error("Failed to load: " + key + ", reason:" + e.getLocalizedMessage()); if (key.isDebug()) { LOG.debug("Load of: " + key + ", failure exception" + e); } } reloadTime = System.currentTimeMillis(); } return this; }
private void load(final File source, Properties props) throws IOException { FileInputStream in = new FileInputStream(source); try { props.load(in); if (key.isDecrypt()) { try { EncryptionSupport.decrypt(this.props); } catch (NoClassDefFoundError e) { // this Happens whe jasypt is not on the classpath.. key.setDecrypt(false); LOG.info("jasypt is not on the classpath: password decryption disabled."); } } } finally { in.close(); } }
private void load(final File source, Properties props) throws IOException { FileInputStream in = new FileInputStream(source); try { props.load(in); if (key.isDecrypt()) { try { EncryptionSupport.decrypt(this.props); } catch (NoClassDefFoundError e) { // this Happens whe jasypt is not on the classpath.. key.setDecrypt(false); LOG.info("jasypt is not on the classpath: password decryption disabled."); } } } finally { in.close(); } }
public ReloadableProperties load(String nameProperty, String fallbackName, Map options) { ReloadableProperties result; FileNameKey key = new FileNameKey(nameProperty, fallbackName, options); key.setDebug(debug); synchronized (staticCache) { result = staticCache.get(key); if (result == null) { result = new ReloadableProperties(key); staticCache.put(key, result); } } return result.obtained(); }
public ReloadableProperties load(String nameProperty, String fallbackName, Map options) { ReloadableProperties result; FileNameKey key = new FileNameKey(nameProperty, fallbackName, options); key.setDebug(debug); synchronized (staticCache) { result = staticCache.get(key); if (result == null) { result = new ReloadableProperties(key); staticCache.put(key, result); } } return result.obtained(); }
public FileNameKey(String nameProperty, String fallbackName, Map options) { this.file = new File(baseDir(options), stringOption(nameProperty, fallbackName, options)); absPath = file.getAbsolutePath(); reload = booleanOption("reload", options); decrypt = booleanOption("decrypt", options); }
public FileNameKey(String nameProperty, String fallbackName, Map options) { this.file = new File(baseDir(options), stringOption(nameProperty, fallbackName, options)); absPath = file.getAbsolutePath(); reload = booleanOption("reload", options); decrypt = booleanOption("decrypt", options); }
private void load(final File source, Properties props) throws IOException { FileInputStream in = new FileInputStream(source); try { props.load(in); if (key.isDecrypt()) { try { EncryptionSupport.decrypt(this.props); } catch (NoClassDefFoundError e) { // this Happens whe jasypt is not on the classpath.. key.setDecrypt(false); LOG.info("jasypt is not on the classpath: password decryption disabled."); } } } finally { in.close(); } }