- File file = null;
- try {
- file = resource.getFile();
- return file.getCanonicalPath();
- } catch (IOException e) {
- if (log.isTraceEnabled())
- log
- .trace("Resource "
- + resource
- + " is not available on the file system. Retrieving it...");
- }
+ File file = fileFromResource(resource);
+ if (file != null)
+ try {
+ return file.getCanonicalPath();
+ } catch (IOException e1) {
+ // silent
+ }
+
+ if (log.isTraceEnabled())
+ log.trace("Resource " + resource
+ + " is not available on the file system. Retrieving it...");