Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 08:51:28-0500)
Maven home: C:\Java\apache-maven-3.0.5\bin\..
Java version: 1.7.0_17, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_17\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 08:51:28-0500) Maven home: C:\Java\apache-maven-3.0.5\bin\.. Java version: 1.7.0_17, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk1.7.0_17\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Description
Add the API: copyInputStreamToFile(final InputStream source, final File destination, boolean closeSource)
/** * Copies bytes from an {@link InputStream} <code>source</code> to a file * <code>destination</code>. The directories up to <code>destination</code> * will be created if they don't already exist. <code>destination</code> * will be overwritten if it already exists. * * @param source the <code>InputStream</code> to copy bytes from, must not be {@code null}, will be closed * @param destination the non-directory <code>File</code> to write bytes to * (possibly overwriting), must not be {@code null} * @param closeSource If true, closes the <code>source</code> * @throws IOException if <code>destination</code> is a directory * @throws IOException if <code>destination</code> cannot be written * @throws IOException if <code>destination</code> needs creating but can't be * @throws IOException if an IO error occurs during copying * @since 2.5 */ public static void copyInputStreamToFile(final InputStream source, final File destination, boolean closeSource) throws IOException {
Related to IO-380.
Attachments
Issue Links
- is related to
-
IO-380 FileUtils.copyInputStreamToFile should document it closes the input source
- Closed