ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sbaill...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional AbstractXSLTLiaisonTest.java
Date Tue, 21 Aug 2001 12:37:43 GMT
sbailliez    01/08/21 05:37:43

  Modified:    src/testcases/org/apache/tools/ant/taskdefs/optional Tag:
                        ANT_14_BRANCH AbstractXSLTLiaisonTest.java
  Log:
  Throw a FileNotFoundException when not able to load a data file.
  This will give more meaningful feedback than a NPE.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +6 -1      jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/AbstractXSLTLiaisonTest.java
  
  Index: AbstractXSLTLiaisonTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/AbstractXSLTLiaisonTest.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- AbstractXSLTLiaisonTest.java	2001/08/13 06:51:53	1.1.2.2
  +++ AbstractXSLTLiaisonTest.java	2001/08/21 12:37:43	1.1.2.3
  @@ -62,6 +62,7 @@
   import javax.xml.parsers.DocumentBuilder;
   import javax.xml.parsers.DocumentBuilderFactory;
   import java.io.File;
  +import java.io.FileNotFoundException;
   import java.net.URL;
   
   /**
  @@ -85,8 +86,12 @@
       // to override
       protected abstract XSLTLiaison createLiaison() throws Exception ;
   
  -    protected File getFile(String name){
  +    /** load the file from the caller classloader that loaded this class */
  +    protected File getFile(String name) throws FileNotFoundException {
           URL url = getClass().getResource(name);
  +        if (url == null){
  +          throw new FileNotFoundException("Unable to load '" + name + "' from classpath");
  +        }
           return new File(url.getFile());
       }
   
  
  
  

Mime
View raw message