Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0, 2.0
-
None
-
Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500)
Maven home: C:\Java\apache-maven-3.0.3\bin\..
Java version: 1.6.0_29, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_29\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500) Maven home: C:\Java\apache-maven-3.0.3\bin\.. Java version: 1.6.0_29, vendor: Sun Microsystems Inc. Java home: C:\Program Files\Java\jdk1.6.0_29\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Description
Add APIs to write FileContent objects to an OutputStream, FileContent, and FileObject.
In 1.0, 2.0, all writing must be done manually via FileContent#getOutputStream() or FileUtil.
Make writing a first class citizen in the API.
Make FileUtil reuse the new FileContent API.
write(FileContent)
write(FileObject)
write(OutputStream)
write(OutputStream, int)
In more detail:
/** * Writes this content to another FileContent. * * @param output * The target OutputStream. * @throws IOException * if an error occurs writing the content. * @since 2.1 */ long write(FileContent output) throws IOException; /** * Writes this content to another FileObject. * * @param file * The target FileObject. * @throws IOException * if an error occurs writing the content. * @since 2.1 */ long write(FileObject file) throws IOException; /** * Writes this content to an OutputStream. * * @param output * The target OutputStream. * @throws IOException * if an error occurs writing the content. * @since 2.1 */ long write(OutputStream output) throws IOException; /** * Writes this content to an OutputStream. * * @param output * The target OutputStream. * @param bufferSize * The buffer size to write data chunks. * @throws IOException * if an error occurs writing the file. * @since 2.1 */ long write(OutputStream output, int bufferSize) throws IOException;