[Yanel-dev] virtual file system node does not get deleted

Evaldas Taroza etaroza at optaros.com
Mon Mar 3 14:27:08 CET 2008


Josias Thöny wrote:
> Evaldas Taroza wrote:
>> I attached the patch. However, the problem is still there. Although it 
>> is maybe only related to Windows but still the file should be somehow 
>> deleted...
> 
> Do you think the file is still accessed by Yanel itself? Or maybe by 
> some other application?
> If it's accessed by Yanel, maybe we forgot to close a stream somewhere.

I came to a conclusion that org.apache.commons.io does not work properly 
  (at least on Windows). The thing is it does not close the file 
input/output streams. I have to close the streams explicitly, for instance:
1)
InputStream in = node.getInputStream();
content = IOUtils.toByteArray(in);
in.close();
2)
OutputStream out = node.getOutputStream();
IOUtils.copy(contentInputStream, out);
out.close();

Only then the node can be deleted.

Evaldas

-- 
+41 79 616 53 76
www.linkedin.com/in/taroza

Optaros - www.optaros.com


More information about the Yanel-development mailing list