Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-14

[compress] CBZip2InputStream doesn't close the source stream

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 36597

    Description

      Hi there,

      I used compress component in sandbox via VFS component. And When I accessed
      a tbz2 file via VFS, I could not remove the tbz2 file after closing stream.
      I checked some codes and I found the reason of the phenomenon.
      When a client program accessed a tbz2 file, the code uses TarFileSystem
      ( org.apache.commons.vfs.provider.tar.TarFileSystem ). TarFileSystem uses
      CBZip2InputStream via Bzip2FileObject.wrapInputStream and the source
      stream is created from FileInputStream like this:

      class TarFileSystem

      ... snip ...

      protected TarInputStream createTarFile(final File file) throws
      FileSystemException

      ... snip ...

      else if ("tbz2".equalsIgnoreCase(getRootName().getScheme()))

      { return new TarInputStream(Bzip2FileObject.wrapInputStream( file.getAbsolutePath(), new FileInputStream(file))); }

      I think CBZip2InputStream should close source stream like BufferedInputStream
      and FilteredInputStream.

      Could you please consider to close source stream in CBZip2InputStream#close() ?

      Thanks,

      Hiroki

      Attachments

        Activity

          People

            Unassigned Unassigned
            hiroki.ata@gmail.com Hiroki Ata
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: