This content has been marked as final.
Show 4 replies
-
1. Re: VFS & Commons Configuration issue
alesj Apr 14, 2009 5:53 AM (in response to past)If you work directly on URLs it should work.
There are some cases where we were able to plug-in our VFS impl:
* Seam
* Spring
* Drools
* Camel
Or I submitted a patch that did work explicitly on URLs,
hence hiding the VFS underneath.
* Facelets
What's the code that fails? -
2. Re: VFS & Commons Configuration issue
past Apr 14, 2009 6:39 AM (in response to past)Essentially the FileChangedReloadingStrategy from Commons Configuration was doing this:
private File fileFromURL(URL url) { if (JAR_PROTOCOL.equals(url.getProtocol())) { String path = url.getPath(); try { return ConfigurationUtils.fileFromURL(new URL(path.substring(0, path.indexOf('!')))); } catch (MalformedURLException mex) { return null; } } else { return ConfigurationUtils.fileFromURL(url); } }
I extended it as follows and it's working now:private File fileFromURL(URL url) { if (VFSFILE_PROTOCOL.equals(url.getProtocol())) { String path = url.getPath(); try { return ConfigurationUtils.fileFromURL(new URL("file:" + path)); } catch (MalformedURLException mex) { return null; } } else if (JAR_PROTOCOL.equals(url.getProtocol())) { String path = url.getPath(); try { return ConfigurationUtils.fileFromURL(new URL(path.substring(0, path.indexOf('!')))); } catch (MalformedURLException mex) { return null; } } else return ConfigurationUtils.fileFromURL(url); }
Can you see anything wrong with this approach? -
3. Re: VFS & Commons Configuration issue
alesj Apr 14, 2009 7:27 AM (in response to past)It might not always work if the resource is nested,
but then so wouldn't the original version with jar protocol handling. -
4. Re: VFS & Commons Configuration issue
juergen.zimmermann Apr 15, 2009 1:02 AM (in response to past)BTW, Jersey (reference impl. for JAX-RS) is patched using the same idea.