/** * Convert an Aattributes object into a Map * @param att * @return */ public final static Map<String,String> normalize(Attributes att) { Set<Map.Entry<Object,Object>> entries = att.entrySet(); Map<String,String> pristine = new HashMap<String,String>(entries.size()); for(Map.Entry<Object,Object> entry : entries) { String key = entry.getKey().toString(); String value = decode(entry.getValue().toString()); pristine.put(key, value); } return pristine; }
/** * Convert an Aattributes object into a Map * @param att * @return */ public final static Map<String,String> normalize(Attributes att) { Set<Map.Entry<Object,Object>> entries = att.entrySet(); Map<String,String> pristine = new HashMap<String,String>(entries.size()); for(Map.Entry<Object,Object> entry : entries) { String key = entry.getKey().toString(); String value = decode(entry.getValue().toString()); pristine.put(key, value); } return pristine; }
/** * Convert an Aattributes object into a Map * @param att * @return */ public final static Map<String,String> normalize(Attributes att) { Set<Map.Entry<Object,Object>> entries = att.entrySet(); Map<String,String> pristine = new HashMap<String,String>(entries.size()); for(Map.Entry<Object,Object> entry : entries) { String key = entry.getKey().toString(); String value = decode(entry.getValue().toString()); if(key == null) // impossible! continue; pristine.put(key, value); } return pristine; }
public void process() throws RemoteException { // format: // "PlainTextActionReporterSUCCESS..." // or // "PlainTextActionReporterFAILURE..." String good = MAGIC + SUCCESS; String bad = MAGIC + FAILURE; response = ManifestUtils.decode(response); if (response.startsWith(good)) { throw new RemoteSuccessException(response.substring(good.length())); } else if (response.startsWith(bad)) { throw new RemoteSuccessException(response.substring(bad.length())); } else { throw new RemoteFailureException( strings.get("unknownFormat", good, bad, response)); } }
public void process() throws RemoteException { // format: // "PlainTextActionReporterSUCCESS..." // or // "PlainTextActionReporterFAILURE..." String good = MAGIC + SUCCESS; String bad = MAGIC + FAILURE; response = ManifestUtils.decode(response); if (response.startsWith(good)) { throw new RemoteSuccessException(response.substring(good.length())); } else if (response.startsWith(bad)) { throw new RemoteSuccessException(response.substring(bad.length())); } else { throw new RemoteFailureException( strings.get("unknownFormat", response)); } }