/** * Converts request into pipe bindings * @param request from where to extract bindings * @param writeAllowed should we consider this execution is about to modify content * @return map of bindings * @throws IOException in case something turns wrong with an input stream */ protected Map getBindingsFromRequest(SlingHttpServletRequest request, boolean writeAllowed) throws IOException{ Map bindings = new HashMap<>(); String dryRun = request.getParameter(BasePipe.DRYRUN_KEY); if (StringUtils.isNotBlank(dryRun) && !dryRun.equals(Boolean.FALSE.toString())) { bindings.put(BasePipe.DRYRUN_KEY, true); } String paramBindings = request.getParameter(PARAM_BINDINGS); if (StringUtils.isNotBlank(paramBindings)){ try { bindings.putAll(JsonUtil.unbox(JsonUtil.parseObject(paramBindings))); } catch (Exception e){ log.error("Unable to retrieve bindings information", e); } } if (request.getRequestParameterMap() != null && request.getRequestParameterMap().containsKey(PARAM_FILE)){ bindings.put(AbstractInputStreamPipe.BINDING_IS, request.getRequestParameter(PARAM_FILE).getInputStream()); } bindings.put(BasePipe.READ_ONLY, !writeAllowed); return bindings; }