/** * Constructor using a path to restrict the information * returned by the list command * * @param pConfig proxy target configuration or <code>null</code> if no proxy should be used * @param pPath path into the JSON response. The path <strong>must already be * properly escaped</strong> when it contains slashes or exclamation marks. * You can use {@link #escape(String)} in order to escape a single path element. */ public J4pListRequest(J4pTargetConfig pConfig, String pPath) { super(J4pType.LIST,pConfig); pathElements = splitPath(pPath); }
@Override JSONObject toJson() { JSONObject ret = super.toJson(); if (pathElements != null) { StringBuilder path = new StringBuilder(); for (int i = 0; i < pathElements.size(); i++) { path.append(escape(pathElements.get(i))); if (i < pathElements.size() - 1) { path.append("/"); } } ret.put("path",path.toString()); } return ret; }