jboynes     2004/02/28 22:11:32

  Modified:    modules/deployment/src/java/org/apache/geronimo/deployment
                        Deployer.java
  Log:
  Handle IllegalArgEx thrown by URI.resolve by converting to MalformedURLEx
  Indicates the location passed is not readable file and not a valid URL
  
  Revision  Changes    Path
  1.14      +7 -2      
incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
  
  Index: Deployer.java
  ===================================================================
  RCS file: 
/home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Deployer.java     27 Feb 2004 00:58:30 -0000      1.13
  +++ Deployer.java     29 Feb 2004 06:11:32 -0000      1.14
  @@ -209,7 +209,12 @@
           if (f.exists() && f.canRead()) {
               return f.toURI().toURL();
           }
  -        return new File(".").toURI().resolve(location).toURL();
  +        try {
  +            return new File(".").toURI().resolve(location).toURL();
  +        } catch (IllegalArgumentException e) {
  +            // thrown by URI.resolve if the location is not valid
  +            throw (MalformedURLException) new MalformedURLException("Invalid 
location: "+location).initCause(e);
  +        }
       }
   
       private static class Command {
  
  
  

Reply via email to