Uploaded image for project: 'Commons VFS'
  1. Commons VFS
  2. VFS-373

Add FileContent write APIs

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0, 2.0
    • 2.1
    • None

    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;
      

      Attachments

        Activity

          People

            ggregory Gary D. Gregory
            ggregory Gary D. Gregory
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: