public static void writeTo(OutputStream outputStream, InputStream in, boolean close) throws IOException { writeTo(outputStream, in, BUFFER_SIZE, close); }
public static void writeTo(File file, InputStream in) throws IOException { writeTo(file, in, BUFFER_SIZE); }
public static void writeTo(File file, InputStream in, int bufferSize) throws IOException { writeTo(new FileOutputStream(file), in, bufferSize, true); }
/** * Writes the given string as data to the given file */ public static void writeTo(File newFile, String text) throws IOException { writeTo(newFile, new ByteArrayInputStream(text.getBytes())); }
protected Response doUploadFile(final String path, String message, final InputStream body) throws Exception { this.message = message; final File file = getRelativeFile(path); boolean exists = file.exists(); if (LOG.isDebugEnabled()) { LOG.debug("writing file: " + file.getPath()); } file.getParentFile().mkdirs(); IOHelpers.writeTo(file, body); String status = exists ? "updated" : "created"; return Response.ok(new StatusDTO(path, status)).build(); }
IOHelpers.writeTo(file, in);
text = text.replaceFirst("<description>(.*)</description>", "<description>" + description + "</description>"); IOHelpers.writeTo(pom, text);