Commons Compress
  1. Commons Compress
  2. COMPRESS-14

[compress] CBZip2InputStream doesn't close the source stream

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      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

        Activity

        Hiroki Ata created issue -
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 36597 12342550
        Henri Yandell made changes -
        Component/s Sandbox [ 12311131 ]
        Key COM-2398 SANDBOX-29
        Project Commons [ 12310458 ] Commons Sandbox [ 12310491 ]
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Affects Version/s unspecified [ 12311647 ]
        Henri Yandell made changes -
        Component/s Compress [ 12311183 ]
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Dennis Lundberg made changes -
        Project Commons Sandbox [ 12310491 ] Commons Compress [ 12310904 ]
        Key SANDBOX-29 COMPRESS-14
        Component/s Compress [ 12311183 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Hiroki Ata
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development