[ https://issues.apache.org/jira/browse/IO-381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13651940#comment-13651940 ]
Gary Gregory commented on IO-381: --------------------------------- The style of the class is unfortunate IMO: copySourceTypeToDestType(SourceType, DestType, ...). I would have rather seen copyToDestType(). So I follow the current style of the APIs. I though that adding a copyToFile(InputStream, File) which does not close next to copyInputStreamToFile(InputStream, File) which does close would be confusing. > Add FileUtils.copyInputStreamToFile API with option to leave the source open > ---------------------------------------------------------------------------- > > Key: IO-381 > URL: https://issues.apache.org/jira/browse/IO-381 > Project: Commons IO > Issue Type: New Feature > Components: Utilities > Environment: 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" > Reporter: Gary Gregory > Assignee: Gary Gregory > Fix For: 2.5 > > > Add the API: {{copyInputStreamToFile(final InputStream source, final File > destination, boolean closeSource)}} > {code:java} > /** > * 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 { > {code} > Related to [IO-380]. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira