/** * Load event map from a external resource * * @return the event map * @throws IOException */ protected Map<Version, Map<String, String>> loadMessageStructures() throws IOException { Map<Version, Map<String, String>> map = new HashMap<Version, Map<String, String>>(); for (Version v : Version.values()) { String resource = getEventMapDirectory() + v.getVersion() + ".properties"; InputStream in = getResource(resource); if (in != null) { try { Properties structures = new Properties(); structures.load(in); Map<String, String> structureMap = new HashMap<String, String>(); for(Map.Entry<Object, Object> next : structures.entrySet()) { structureMap.put((String)next.getKey(), (String)next.getValue()); } map.put(v, Collections.unmodifiableMap(structureMap)); } finally { in.close(); } } } return map; }
/** * Load event map from a external resource * * @return the event map * @throws IOException */ protected Map<Version, Map<String, String>> loadMessageStructures() throws IOException { Map<Version, Map<String, String>> map = new HashMap<Version, Map<String, String>>(); for (Version v : Version.values()) { String resource = getEventMapDirectory() + v.getVersion() + ".properties"; InputStream in = getResource(resource); if (in != null) { try { Properties structures = new Properties(); structures.load(in); Map<String, String> structureMap = new HashMap<String, String>(); for(Map.Entry<Object, Object> next : structures.entrySet()) { structureMap.put((String)next.getKey(), (String)next.getValue()); } map.put(v, Collections.unmodifiableMap(structureMap)); } finally { in.close(); } } } return map; }