Add FileContent write APIs
--------------------------

                 Key: VFS-373
                 URL: https://issues.apache.org/jira/browse/VFS-373
             Project: Commons VFS
          Issue Type: New Feature
    Affects Versions: 1.0, 2.0
         Environment: 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"
            Reporter: Gary D. Gregory
            Assignee: Gary D. Gregory
             Fix For: Nightly Builds


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.

{code:java}
write(FileContent)
write(FileObject)
write(OutputStream)
write(OutputStream, int)
{code}

In more detail:

{code:java}
    /**
     * 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;
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to