Refine search
private static Properties loadFromFile(String uri) throws IOException { InputStream inputStream = null; Properties inputProperties = new Properties(); Properties outputProperties = new Properties(); if( new File(uri).exists() ) { inputStream = new FileInputStream(uri); } else { inputStream = new URL(uri).openStream(); } try { inputProperties.loadFromXML(inputStream); } finally { inputStream.close(); } Enumeration namesEnumeration = inputProperties.propertyNames(); while(namesEnumeration.hasMoreElements()) { String propertyName = (String)namesEnumeration.nextElement(); String propertyValue = inputProperties.getProperty(propertyName); propertyValue = propertyValue.trim(); // perform JBossAS style property substitutions. JBTM-369 propertyValue = StringPropertyReplacer.replaceProperties(propertyValue); outputProperties.setProperty(propertyName, propertyValue); } return outputProperties; }
value = props.getProperty(key); else value = System.getProperty(key); value = props.getProperty(realKey); else value = System.getProperty(realKey); value = resolveCompositeKey(realKey, props); value = resolveCompositeKey(key, props);
/** * Go through the input string and replace any occurance of ${p} with * the System.getProperty(p) value. If there is no such property p defined, * then the ${p} reference will remain unchanged. * * If the property reference is of the form ${p:v} and there is no such property p, * then the default value v will be returned. * * If the property reference is of the form ${p1,p2} or ${p1,p2:v} then * the primary and the secondary properties will be tried in turn, before * returning either the unchanged input, or the default value. * * The property ${/} is replaced with System.getProperty("file.separator") * value and the property ${:} is replaced with System.getProperty("path.separator"). * * @param string - the string with possible ${} references * @return the input string with all property references replaced if any. * If there are no valid references the input string will be returned. */ public static String replaceProperties(final String string) { return replaceProperties(string, null); }
value = props.getProperty(key); else value = System.getProperty(key); value = props.getProperty(realKey); else value = System.getProperty(realKey); value = resolveCompositeKey(realKey, props); value = resolveCompositeKey(key, props);
/** * Go through the input string and replace any occurance of ${p} with * the System.getProperty(p) value. If there is no such property p defined, * then the ${p} reference will remain unchanged. * * If the property reference is of the form ${p:v} and there is no such property p, * then the default value v will be returned. * * If the property reference is of the form ${p1,p2} or ${p1,p2:v} then * the primary and the secondary properties will be tried in turn, before * returning either the unchanged input, or the default value. * * The property ${/} is replaced with System.getProperty("file.separator") * value and the property ${:} is replaced with System.getProperty("path.separator"). * * @param string - the string with possible ${} references * @return the input string with all property references replaced if any. * If there are no valid references the input string will be returned. */ public static String replaceProperties(final String string) { return replaceProperties(string, null); }
private static Properties loadFromFile(String uri) throws IOException { InputStream inputStream = null; Properties inputProperties = new Properties(); Properties outputProperties = new Properties(); if( new File(uri).exists() ) { inputStream = new FileInputStream(uri); } else { // it's probably a file embedded in a .jar inputStream = new URL(uri).openStream(); } try { loadFromXML(inputProperties,inputStream); } finally { inputStream.close(); } Enumeration namesEnumeration = inputProperties.propertyNames(); while(namesEnumeration.hasMoreElements()) { String propertyName = (String)namesEnumeration.nextElement(); String propertyValue = inputProperties.getProperty(propertyName); propertyValue = propertyValue.trim(); // perform JBossAS style property substitutions. JBTM-369 propertyValue = StringPropertyReplacer.replaceProperties(propertyValue); outputProperties.setProperty(propertyName, propertyValue); } return outputProperties; }
value = props.getProperty(key); else value = System.getProperty(key); value = props.getProperty(realKey); else value = System.getProperty(realKey); value = resolveCompositeKey(realKey, props); value = resolveCompositeKey(key, props);
/** * Go through the input string and replace any occurance of ${p} with * the System.getProperty(p) value. If there is no such property p defined, * then the ${p} reference will remain unchanged. * * If the property reference is of the form ${p:v} and there is no such property p, * then the default value v will be returned. * * If the property reference is of the form ${p1,p2} or ${p1,p2:v} then * the primary and the secondary properties will be tried in turn, before * returning either the unchanged input, or the default value. * * The property ${/} is replaced with System.getProperty("file.separator") * value and the property ${:} is replaced with System.getProperty("path.separator"). * * @param string - the string with possible ${} references * @return the input string with all property references replaced if any. * If there are no valid references the input string will be returned. */ public static String replaceProperties(final String string) { return replaceProperties(string, null); }
private static Properties loadFromFile(String uri) throws IOException { InputStream inputStream = null; Properties inputProperties = new Properties(); Properties outputProperties = new Properties(); if( new File(uri).exists() ) { inputStream = new FileInputStream(uri); } else { // it's probably a file embedded in a .jar inputStream = new URL(uri).openStream(); } try { loadFromXML(inputProperties,inputStream); } finally { inputStream.close(); } Enumeration namesEnumeration = inputProperties.propertyNames(); while(namesEnumeration.hasMoreElements()) { String propertyName = (String)namesEnumeration.nextElement(); String propertyValue = inputProperties.getProperty(propertyName); propertyValue = propertyValue.trim(); // perform JBossAS style property substitutions. JBTM-369 propertyValue = StringPropertyReplacer.replaceProperties(propertyValue); outputProperties.setProperty(propertyName, propertyValue); } return outputProperties; }
value = props.getProperty(key); else value = System.getProperty(key); value = props.getProperty(realKey); else value = System.getProperty(realKey); value = resolveCompositeKey(realKey, props); value = resolveCompositeKey(key, props);
/** * Go through the input string and replace any occurance of ${p} with * the System.getProperty(p) value. If there is no such property p defined, * then the ${p} reference will remain unchanged. * * If the property reference is of the form ${p:v} and there is no such property p, * then the default value v will be returned. * * If the property reference is of the form ${p1,p2} or ${p1,p2:v} then * the primary and the secondary properties will be tried in turn, before * returning either the unchanged input, or the default value. * * The property ${/} is replaced with System.getProperty("file.separator") * value and the property ${:} is replaced with System.getProperty("path.separator"). * * @param string - the string with possible ${} references * @return the input string with all property references replaced if any. * If there are no valid references the input string will be returned. */ public static String replaceProperties(final String string) { return replaceProperties(string, null); }
private static Properties loadFromFile(String uri) throws IOException { InputStream inputStream = null; Properties inputProperties = new Properties(); Properties outputProperties = new Properties(); if( new File(uri).exists() ) { inputStream = new FileInputStream(uri); } else { // it's probably a file embedded in a .jar inputStream = new URL(uri).openStream(); } try { loadFromXML(inputProperties,inputStream); } finally { inputStream.close(); } Enumeration namesEnumeration = inputProperties.propertyNames(); while(namesEnumeration.hasMoreElements()) { String propertyName = (String)namesEnumeration.nextElement(); String propertyValue = inputProperties.getProperty(propertyName); propertyValue = propertyValue.trim(); // perform JBossAS style property substitutions. JBTM-369 propertyValue = StringPropertyReplacer.replaceProperties(propertyValue); outputProperties.setProperty(propertyName, propertyValue); } return outputProperties; }
value = props.getProperty(key); else value = System.getProperty(key); value = props.getProperty(realKey); else value = System.getProperty(realKey); value = resolveCompositeKey(realKey, props); value = resolveCompositeKey(key, props);
/** * Go through the input string and replace any occurance of ${p} with * the System.getProperty(p) value. If there is no such property p defined, * then the ${p} reference will remain unchanged. * * If the property reference is of the form ${p:v} and there is no such property p, * then the default value v will be returned. * * If the property reference is of the form ${p1,p2} or ${p1,p2:v} then * the primary and the secondary properties will be tried in turn, before * returning either the unchanged input, or the default value. * * The property ${/} is replaced with System.getProperty("file.separator") * value and the property ${:} is replaced with System.getProperty("path.separator"). * * @param string - the string with possible ${} references * @return the input string with all property references replaced if any. * If there are no valid references the input string will be returned. */ public static String replaceProperties(final String string) { return replaceProperties(string, null); }
private static Properties loadFromFile(String uri) throws IOException { InputStream inputStream = null; Properties inputProperties = new Properties(); Properties outputProperties = new Properties(); if( new File(uri).exists() ) { inputStream = new FileInputStream(uri); } else { // it's probably a file embedded in a .jar inputStream = new URL(uri).openStream(); } try { loadFromXML(inputProperties,inputStream); } finally { inputStream.close(); } Enumeration namesEnumeration = inputProperties.propertyNames(); while(namesEnumeration.hasMoreElements()) { String propertyName = (String)namesEnumeration.nextElement(); String propertyValue = inputProperties.getProperty(propertyName); propertyValue = propertyValue.trim(); // perform JBossAS style property substitutions. JBTM-369 propertyValue = StringPropertyReplacer.replaceProperties(propertyValue); outputProperties.setProperty(propertyName, propertyValue); } return outputProperties; }
value = props.getProperty(key); else value = System.getProperty(key); value = props.getProperty(realKey); else value = System.getProperty(realKey); value = resolveCompositeKey(realKey, props); value = resolveCompositeKey(key, props);
/** * Go through the input string and replace any occurance of ${p} with * the System.getProperty(p) value. If there is no such property p defined, * then the ${p} reference will remain unchanged. * * If the property reference is of the form ${p:v} and there is no such property p, * then the default value v will be returned. * * If the property reference is of the form ${p1,p2} or ${p1,p2:v} then * the primary and the secondary properties will be tried in turn, before * returning either the unchanged input, or the default value. * * The property ${/} is replaced with System.getProperty("file.separator") * value and the property ${:} is replaced with System.getProperty("path.separator"). * * @param string - the string with possible ${} references * @return the input string with all property references replaced if any. * If there are no valid references the input string will be returned. */ public static String replaceProperties(final String string) { return replaceProperties(string, null); }
Properties inputProperties = new Properties(); Properties outputProperties = new Properties(); Enumeration namesEnumeration = inputProperties.propertyNames(); while(namesEnumeration.hasMoreElements()) { String propertyName = (String)namesEnumeration.nextElement(); propertyValue = StringPropertyReplacer.replaceProperties(propertyValue); outputProperties.setProperty(propertyName, propertyValue);
value = props.getProperty(key); else value = System.getProperty(key); value = props.getProperty(realKey); else value = System.getProperty(realKey); value = resolveCompositeKey(realKey, props); value = resolveCompositeKey(key, props);
/** * Go through the input string and replace any occurance of ${p} with * the System.getProperty(p) value. If there is no such property p defined, * then the ${p} reference will remain unchanged. * * If the property reference is of the form ${p:v} and there is no such property p, * then the default value v will be returned. * * If the property reference is of the form ${p1,p2} or ${p1,p2:v} then * the primary and the secondary properties will be tried in turn, before * returning either the unchanged input, or the default value. * * The property ${/} is replaced with System.getProperty("file.separator") * value and the property ${:} is replaced with System.getProperty("path.separator"). * * @param string - the string with possible ${} references * @return the input string with all property references replaced if any. * If there are no valid references the input string will be returned. */ public static String replaceProperties(final String string) { return replaceProperties(string, null); }