public static void writeString(OutputStream os, String string, String encoding, boolean normalizeLineSeparator) { writeString(os, string, encoding, normalizeLineSeparator, true); }
public static void writeString(Writer writer, String string, boolean normalizeLineSeparator) { writeString(writer, string, normalizeLineSeparator, true); }
public static void writeString(OutputStream os, String string, String encoding, boolean normalizeLineSeparator, boolean close) { try { writeString(new OutputStreamWriter(os, encoding), string, normalizeLineSeparator, close); } catch (UnsupportedEncodingException ex) { throw new IORuntimeException(ex); } }
void commit(String response) throws IOException { IOUtils.writeString(getResponse().getOutputStream(), response, getResponseCharset(), false, false); }
void createMessages(String messagesName) { OutputStream os; try { os = new FileResource(getSourceCreator().getResourcesDirectory()) .getChildResource(messagesName + SUFFIX_XPROPERTIES) .getOutputStream(); } catch (IOException ex) { throw new IORuntimeException(ex); } IOUtils.writeString(os, "", "UTF-8", false); } }
public static void writeString(Resource resource, String string, String encoding, boolean normalizeLineSeparator) { if (resource.isDirectory()) { throw new IllegalArgumentException("Resource type mismatch: " + resource.getURL()); } if (string == null) { if (resource.exists()) { resource.delete(); } return; } resource.getParentResource().mkdirs(); try { IOUtils.writeString(resource.getOutputStream(), string, encoding, normalizeLineSeparator); } catch (ResourceNotFoundException ex) { throw new IORuntimeException(ex); } }
public Response act(Request request, PathMetaData pathMetaData) { Template template = getTemplate(request); if (template == null || !template.exists()) { return VoidResponse.INSTANCE; } String body = request.getParameter(PARAM_BODY); if (body == null) { return VoidResponse.INSTANCE; } try { IOUtils.writeString(template.getOutputStream(), body, "UTF-8", false); } catch (IOException ex) { throw new IORuntimeException("Can't write template: path=" + template.getPath(), ex); } return VoidResponse.INSTANCE; } }
resource.getParent().mkdirs(); try { IOUtils.writeString(resource.getOutputStream(variant), value, "UTF-8", true); } catch (ResourceNotFoundException ex) {