I'm using Icefaces. I generate reports for users and provide it using FileResource class. I do nothing with the file, since it should be available for download whenever user clicks on link to resource.
However, after user logs out, th开发者_如何学Goe report is no longer needed and should be deleted. Is there a build-in option in IceFaces to bind FileResource with session and automatically delete it when session expires?
Resource binds to a file which already exists when you are binding it to a Resource. It is expected that the file would be needed again, so there is probably no point in providing a method to delete the file.
The IceFaces tutorial on FileUpload talks about manually deleting files after session expiry using a session listener. So I guess IceFaces does not provide any method to delete files, whether or not they are binded to a Resource.
精彩评论