public static String encodeUrl(Parameters parameters) { if (parameters == null) { return ""; } StringBuilder sb = new StringBuilder(); boolean first = true; int size = parameters.size(); for (int loc = 0; loc < size; loc++) { if (first) { first = false; } else { sb.append("&"); } String _key = parameters.getKey(loc); String _value = parameters.getValue(_key); if (_value == null) { // Log.i("encodeUrl", "key:" + _key + " 's value is null"); } else { // Log.i("encodeUrl", URLEncoder.encode(parameters.getKey(loc)) // + "=" + URLEncoder.encode(parameters.getValue(loc))); sb.append( URLEncoder.encode(parameters.getKey(loc)) + "=" + URLEncoder.encode(encodeBase64(parameters.getValue(loc).getBytes()))); } } return sb.toString(); }
private com.relteq.sirius.jaxb.Parameter restoreParameter(Parameters db_param) { com.relteq.sirius.jaxb.Parameter param = factory.createParameter(); param.setName(db_param.getName()); param.setValue(db_param.getValue()); return param; }