[
https://issues.apache.org/jira/browse/COMPRESS-14?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dennis Lundberg moved SANDBOX-29 to COMPRESS-14:
------------------------------------------------
Component/s: (was: Compress)
Key: COMPRESS-14 (was: SANDBOX-29)
Project: Commons Compress (was: Commons Sandbox)
> [compress] CBZip2InputStream doesn't close the source stream
> ------------------------------------------------------------
>
> Key: COMPRESS-14
> URL: https://issues.apache.org/jira/browse/COMPRESS-14
> Project: Commons Compress
> Issue Type: Bug
> 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.
-
You can reply to this email to add a comment to the issue online.