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?

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225313#4225313

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225313
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to