I uploading in my app, images and save them in web-app/myCustomFolderImages. When I want delete some of this images, I'm having 2 problems:
Sometimes when I'm deleting file immediately after upload, I can't do this, javaw.exe blocking file. Something is caching this file?
Major problem, when I delete a file, and upload next, console writes this stack:
Resource reload failed!:
java.io.FileNotFoundException: URL [file:.../z5c2ex/004_1_-thumbnail.jpg] cannot be resolved in the file system for resolving its last-modified timestamp
at org.springframework.core.io.AbstractResource.lastModified(AbstractResource.java:144)
at org.springframework.core.io.AbstractFileResolvingResource.lastModified(AbstractFileResolvingResource.java:173)
at org.springframework.core.io.Resource$lastModified.call(Unknown Source)
at org.grails.plugin.resource.ResourceMeta.isDirty(ResourceMeta.groovy:147)
at sun.reflect.GeneratedMethodAccessor679.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springsource.loaded.ri.OriginalClassInvoker.invoke(OriginalClassInvoker.java:47)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1272)...
For Grails resources plugin, these images are static. When I used grails.resources.adhoc.excludes
option, my images aren't rendered at all on the website.
Is there any good way to upload and delete dynamically images (files) from grails app?