You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2006/07/05 05:57:36 UTC

[jira] Updated: (SANDBOX-29) [compress] CBZip2InputStream doesn't close the source stream

     [ http://issues.apache.org/jira/browse/SANDBOX-29?page=all ]

Henri Yandell updated SANDBOX-29:
---------------------------------

    Component: Compress

> [compress] CBZip2InputStream doesn't close the source stream
> ------------------------------------------------------------
>
>          Key: SANDBOX-29
>          URL: http://issues.apache.org/jira/browse/SANDBOX-29
>      Project: Commons Sandbox
>         Type: Bug

>   Components: Compress
>  Environment: Operating System: All
> Platform: All
>     Reporter: Hiroki Ata
>  Attachments: CBZip2InputStream-close-src-stream.patch
>
> 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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org