Refine search
Content content = req.getContent(); if (content == null) throw new WebScriptException("Failed to convert request to JSON"); try String jsonString = content.getContent(); if (jsonString.startsWith("[") == true) result = new JSONObject(jsonString); throw new WebScriptException("Failed to convert request to JSON", exception);
/** * Set the content stream from another content object. * * @param content ScriptContent to set */ public void write(Content content) { ContentService contentService = services.getContentService(); ContentWriter writer = contentService.getWriter(nodeRef, this.property, true); writer.setMimetype(content.getMimetype()); writer.setEncoding(content.getEncoding()); writer.putContent(content.getInputStream()); // update cached variables after putContent() updateContentData(true); }
throw new WebScriptException("Web Script install only supported via HTTP Servlet"); Object content = req.parseContent(); if (content == null || !(content instanceof FormData)) throw new WebScriptException(HttpServletResponse.SC_BAD_REQUEST, "Web Script install request is not multipart/form-data"); throw new WebScriptException(HttpServletResponse.SC_BAD_REQUEST, "Web Script install request expects only one file upload"); InputStream fileIS = file.getContent().getInputStream(); try
String content = req.getContent().getContent(); if (content.length() > 0)
Reader reader = req.getContent().getReader(); BufferedReader br = new BufferedReader(reader); String line = null;
if (c != null) String content = c.getContent(); if (content != null && content.length() > 0)
String content = req.getContent().getContent(); if (content.length() > 0)
Reader reader = req.getContent().getReader(); BufferedReader br = new BufferedReader(reader); String line = null;
if (c != null) String content = c.getContent(); if (content != null && content.length() > 0)
Content content = req.getContent(); if (content == null) throw new WebScriptException("Failed to convert request to JSON"); try String jsonString = content.getContent(); if (jsonString.startsWith("[") == true) result = new JSONObject(jsonString); throw new WebScriptException("Failed to convert request to JSON", exception);
String content = req.getContent().getContent(); JSONParser jp = new JSONParser(); Object o = jp.parse(content);
/** * Set the content stream from another content object. * * @param content ScriptContent to set */ public void write(Content content) { ContentService contentService = services.getContentService(); ContentWriter writer = contentService.getWriter(nodeRef, this.property, true); writer.setMimetype(content.getMimetype()); writer.setEncoding(content.getEncoding()); writer.putContent(content.getInputStream()); // update cached variables after putContent() updateContentData(true); }
Content content = req.getContent(); if (content == null) throw new WebScriptException("Failed to convert request to JSON"); try String jsonString = content.getContent(); if (jsonString.startsWith("[") == true) result = new JSONObject(jsonString); throw new WebScriptException("Failed to convert request to JSON", exception);
String content = req.getContent().getContent(); JSONParser jp = new JSONParser(); Object o = jp.parse(content);
if (applyMimetype) writer.setMimetype(content.getMimetype().toLowerCase()); is = new BufferedInputStream(content.getInputStream()); is.mark(1024); writer.setEncoding(guessEncoding(is, false)); writer.setEncoding(content.getEncoding()); is = content.getInputStream();
if (applyMimetype) writer.setMimetype(content.getMimetype().toLowerCase()); is = new BufferedInputStream(content.getInputStream()); is.mark(1024); writer.setEncoding(guessEncoding(is, false)); writer.setEncoding(content.getEncoding()); is = content.getInputStream();