public static long copy(final Reader reader, final Writer writer) throws IOException { return copy(reader, writer, DEF_CHAR_BUFF_SIZE); }
public static long copy(final InputStream inputStream, final OutputStream outputStream) throws IOException { return copy(inputStream, outputStream, DEF_BUFF_SIZE); }
public static long copy(final Reader reader, final Writer writer) throws IOException { return copy(reader, writer, DEF_CHAR_BUFF_SIZE); }
public static long copy(final Reader reader, final Writer writer) throws IOException { return copy(reader, writer, DEF_CHAR_BUFF_SIZE); }
public static long copy(final InputStream inputStream, final OutputStream outputStream) throws IOException { return copy(inputStream, outputStream, DEF_BUFF_SIZE); }
public static long copy(final InputStream inputStream, final OutputStream outputStream) throws IOException { return copy(inputStream, outputStream, DEF_BUFF_SIZE); }
public static String toString(Reader reader) throws IOException { StringWriter buffer = new StringWriter(); copy(reader, buffer); return buffer.toString(); }
public static String toString(Reader reader) throws IOException { StringWriter buffer = new StringWriter(); copy(reader, buffer); return buffer.toString(); }
public static String toString(Reader reader) throws IOException { StringWriter buffer = new StringWriter(); copy(reader, buffer); return buffer.toString(); }
public static String toString(File file) throws IOException { StringWriter buffer = new StringWriter(); FileReader fileReader = new FileReader(file); copy(fileReader, buffer); return buffer.toString(); }
public static void copy( File src, File dst ) throws IOException { FileInputStream is = null; FileOutputStream os = null; try { is = new FileInputStream(src); os = new FileOutputStream(dst); IOUtils.copy(is,os); } finally { IOUtils.close(is,os); } }
public static void copy( File src, File dst ) throws IOException { FileInputStream is = null; FileOutputStream os = null; try { is = new FileInputStream(src); os = new FileOutputStream(dst); IOUtils.copy(is,os); } finally { IOUtils.close(is,os); } }
public static String toString(File file, String encoding) throws IOException { StringWriter buffer = new StringWriter(); InputStreamReader fileReader = null; try { fileReader = new InputStreamReader(new FileInputStream(file), encoding); IOUtils.copy(fileReader, buffer); return buffer.toString(); } finally { IOUtils.close(buffer); IOUtils.close(fileReader); } }
public static String toString(File file, String encoding) throws IOException { StringWriter buffer = new StringWriter(); InputStreamReader fileReader = null; try { fileReader = new InputStreamReader(new FileInputStream(file), encoding); IOUtils.copy(fileReader, buffer); return buffer.toString(); } finally { IOUtils.close(buffer); IOUtils.close(fileReader); } }
public void create(File target) throws TemplateExecutionException { try { File parent = file.getParentFile(); if (!parent.exists()) { FileUtils.mkdirs(parent); } try (FileOutputStream os = new FileOutputStream(file); InputStream is = getContent()) { IOUtils.copy(is, os); } } catch (IOException e) { throw new TemplateExecutionException(e); } }
public void httpGetBasicAuth(String path, OutputStream outputStream) throws HttpException { logger.debug("HTTP GET W/ BASIC AUTH: " + path); HttpGet request = new HttpGet(convertPath(path)); setBasicAuthHeader(request); try (CloseableHttpResponse response = httpClient.execute(request)) { verifyStatusCode(request, response); if (response.getEntity() == null) { throw new HttpException("Not body returned by url " + request.getURI()); } IOUtils.copy(response.getEntity().getContent(), outputStream); } catch (IOException e) { throw new HttpException(e.getMessage(), e); } }
public static byte[] toByteArray(InputStream inputStream) throws IOException { ByteArrayDataOutputStream buffer = new ByteArrayDataOutputStream(); copy(inputStream, buffer); buffer.close(); return buffer.toByteArray(); }
public static byte[] toByteArray(InputStream inputStream) throws IOException { ByteArrayDataOutputStream buffer = new ByteArrayDataOutputStream(); copy(inputStream, buffer); buffer.close(); return buffer.toByteArray(); }
public static byte[] toByteArray(InputStream inputStream) throws IOException { ByteArrayDataOutputStream buffer = new ByteArrayDataOutputStream(); copy(inputStream, buffer); buffer.close(); return buffer.toByteArray(); }