commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ma...@ops.co.at>
Subject Re: [VFS] FileContentInputStream
Date Wed, 13 Apr 2005 06:36:57 GMT
Hello Darren!

>public InputStream returnStream(FileObject myfile) throws Exception{
>FileContent fc = FileObject.getFileContent();
>InputStream result = fc.getInputStream();
>Return result;
>}
>
>Public void doSomething(FileObject myfile){
>InputStream is = returnStream(myfile);
>//do something with is
>}
>
>This method results in non-working code because as soon as you leave the
>method (or you call fc.close()) the FileContent object and related
>FileContentInputStream innerclass disappears and the InputStream becomes
>nothing.  Before reporting this as a bug, wondering if anyone else has
>any thoughts on this?
>  
>
Sorry, I dont get it.
What do you mean by "disappears" and "becomes nothing"?

*) If you close the filecontent, all streams created by the current 
thread will be closed.
*) If you close the inputStream only this stream will be closed and 
detached from the current thread

Do you get any exception?
What "scheme" do you have a problem with?

---
Mario


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


Mime
View raw message