/** * Implement a quick and dirty sorting mechanism for the given Properties. * @param allProperties * @return the Properties list sorted by it's 'configuration.ordinal' in ascending order. */ private static List<Properties> sortProperties(List<Properties> allProperties) { List<Properties> sortedProperties = new ArrayList<Properties>(); for (Properties p : allProperties) { int configOrder = getConfigurationOrdinal(p); int i; for (i = 0; i < sortedProperties.size(); i++) { int listConfigOrder = getConfigurationOrdinal(sortedProperties.get(i)); if (listConfigOrder > configOrder) { // only go as far as we found a higher priority Properties file break; } } sortedProperties.add(i, p); } return sortedProperties; }
/** * Implement a quick and dirty sorting mechanism for the given Properties. * @param allProperties * @return the Properties list sorted by it's 'configuration.ordinal' in ascending order. */ private static List<Properties> sortProperties(List<Properties> allProperties) { List<Properties> sortedProperties = new ArrayList<Properties>(); for (Properties p : allProperties) { int configOrder = getConfigurationOrdinal(p); int i; for (i = 0; i < sortedProperties.size(); i++) { int listConfigOrder = getConfigurationOrdinal(sortedProperties.get(i)); if (listConfigOrder > configOrder) { // only go as far as we found a higher priority Properties file break; } } sortedProperties.add(i, p); } return sortedProperties; }
/** * Implement a quick and dirty sorting mechanism for the given Properties. * @param allProperties * @return the Properties list sorted by it's 'configuration.ordinal' in ascending order. */ private static List<Properties> sortProperties(List<Properties> allProperties) { List<Properties> sortedProperties = new ArrayList<Properties>(); for (Properties p : allProperties) { int configOrder = getConfigurationOrdinal(p); int i; for (i = 0; i < sortedProperties.size(); i++) { int listConfigOrder = getConfigurationOrdinal(sortedProperties.get(i)); if (listConfigOrder > configOrder) { // only go as far as we found a higher priority Properties file break; } } sortedProperties.add(i, p); } return sortedProperties; }
private static void fillProperties(List<Properties> properties, URL propertyUrl) throws IOException { InputStream is = null; try { is = propertyUrl.openStream(); Properties prop = new Properties(); prop.load(is); properties.add(prop); // a bit debugging output int ordinal = getConfigurationOrdinal(prop); if (LOG.isLoggable(Level.FINE)) { LOG.fine("loading properties with ordinal " + ordinal + " from file " + propertyUrl.getFile()); } } finally { if (is != null) { is.close(); } } }
private static void fillProperties(List<Properties> properties, URL propertyUrl) throws IOException { InputStream is = null; try { is = propertyUrl.openStream(); Properties prop = new Properties(); prop.load(is); properties.add(prop); // a bit debugging output int ordinal = getConfigurationOrdinal(prop); if (LOG.isLoggable(Level.FINE)) { LOG.fine("loading properties with ordinal " + ordinal + " from file " + propertyUrl.getFile()); } } finally { if (is != null) { is.close(); } } }
private static void fillProperties(List<Properties> properties, URL propertyUrl) throws IOException { InputStream is = null; try { is = propertyUrl.openStream(); Properties prop = new Properties(); prop.load(is); properties.add(prop); // a bit debugging output int ordinal = getConfigurationOrdinal(prop); if (LOG.isLoggable(Level.FINE)) { LOG.fine("loading properties with ordinal " + ordinal + " from file " + propertyUrl.getFile()); } } finally { if (is != null) { is.close(); } } }