I have noticed that the IS doesn’t always release/close a filestream. If execution goes according to plan then the file is availble for editing but if an exception happens or you terminate the the execution of a service then IS holds on to this file- preventing editing of this file until you restart the service.
This was orignally an annoyance when I was reading in sample data to test my service but now that I am editing JSPs this is huge pain. Has anyone else noticed this.
I definitely notice this as well. If all goes well with your service, the stream closes fine. But if you go to an exception block, I can not pull the stream from the pipeline and close it. For some reason it is changing the type of the stream from java.io.BufferedInputStream to java.lang.String.
I just figured out my issue. I had a Main/try/catch block. I called getFile in the try block. If an error occurred, i tried to get the variable from the pipeline and close the stream. It wasn’t working. Now I have a:
main
try{
getFile
main
try{
}
catch{
close stream
}
catch
This seems to fix my issue. It’s all about variable declaration.