/** * Convert a Manifest into an easier data structure. It returns a Map of Maps. * The main attributes become the map where the key is MAIN_ATTS. * Entries become named maps as in the Manifest * @param m * @return */ public final static Map<String, Map<String,String>> normalize(Manifest m) { // first add the "main attributes Map<String, Map<String,String>> all = new HashMap<String, Map<String,String>>(); Attributes mainAtt = m.getMainAttributes(); all.put(MAIN_ATTS, normalize(mainAtt)); // now add all the "sub-attributes" Map<String,Attributes> unwashed = m.getEntries(); Set<String> entryNames = unwashed.keySet(); for(String entryName : entryNames) { all.put(entryName, normalize(unwashed.get(entryName))); } return all; }
/** * Convert a Manifest into an easier data structure. It returns a Map of Maps. * The main attributes become the map where the key is MAIN_ATTS. * Entries become named maps as in the Manifest * @param m * @return */ public final static Map<String, Map<String,String>> normalize(Manifest m) { // first add the "main attributes Map<String, Map<String,String>> all = new HashMap<String, Map<String,String>>(); Attributes mainAtt = m.getMainAttributes(); all.put(MAIN_ATTS, normalize(mainAtt)); // now add all the "sub-attributes" Map<String,Attributes> unwashed = m.getEntries(); Set<Map.Entry<String,Attributes>> entries = unwashed.entrySet(); for(Map.Entry<String,Attributes> entry : entries) { String name = entry.getKey(); Attributes value = entry.getValue(); if(name == null || value == null) continue; all.put(name, normalize(value)); } return all; }
/** * Convert a Manifest into an easier data structure. It returns a Map of Maps. * The main attributes become the map where the key is MAIN_ATTS. * Entries become named maps as in the Manifest * @param m * @return */ public final static Map<String, Map<String,String>> normalize(Manifest m) { // first add the "main attributes Map<String, Map<String,String>> all = new HashMap<String, Map<String,String>>(); Attributes mainAtt = m.getMainAttributes(); all.put(MAIN_ATTS, normalize(mainAtt)); // now add all the "sub-attributes" Map<String,Attributes> unwashed = m.getEntries(); Set<Map.Entry<String,Attributes>> entries = unwashed.entrySet(); for(Map.Entry<String,Attributes> entry : entries) { String name = entry.getKey(); Attributes value = entry.getValue(); if(name == null || value == null) continue; all.put(name, normalize(value)); } return all; }
public AdminCommandResponse(InputStream inStream) throws IOException { Manifest m = new Manifest(inStream); m.read(inStream); allRaw = ManifestUtils.normalize(m); mainRaw = ManifestUtils.getMain(allRaw); makeMain(); }
public AdminCommandResponse(InputStream inStream) throws IOException { Manifest m = new Manifest(inStream); m.read(inStream); allRaw = ManifestUtils.normalize(m); mainRaw = ManifestUtils.getMain(allRaw); makeMain(); }
public AdminCommandResponse(InputStream inStream) throws IOException { Manifest m = new Manifest(inStream); m.read(inStream); allRaw = ManifestUtils.normalize(m); mainRaw = ManifestUtils.getMain(allRaw); makeMain(); }