[
https://issues.apache.org/jira/browse/VFS-358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114161#comment-13114161
]
Ralph Goers commented on VFS-358:
---------------------------------
>From what I can see none of the RandomAccessContent implementations close
>their associated FileObject so I'm not sure why that should be done here. It
>seems to me the RandomAccessContent needs to be invalidated during close and
>any further calls should throw an exception.
> RamFileRandomAccessContent.close() does *NOT* call RamFileObject.close().
> -------------------------------------------------------------------------
>
> Key: VFS-358
> URL: https://issues.apache.org/jira/browse/VFS-358
> Project: Commons VFS
> Issue Type: Bug
> Affects Versions: 1.0
> Reporter: Miroslav Pokorny
>
> The problem manifests itself if one uses RandomAccessContent from a
> FileObject which is from ram://. Closing any stream from the RAC does not
> cleanup some counters which means future calls to FileObject.isContentOpen()
> return true which is wrong because the RAC.close().
> The fix to RamFileRandomAccessContent.close() is a simple one liner.
> /*
> * (non-Javadoc)
> *
> * @see org.apache.commons.vfs.RandomAccessContent#close()
> */
> @Override
> public void close() throws IOException {
> // do not try and call rafis.close() which does nothing but call this
> method.
> this.file.close();
> }
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira