glyn        02/02/27 06:54:27

  Modified:    java/src/org/apache/axis/configuration FileProvider.java
  Log:
  Provide diagnostics when configuration file directory is invalid.
  
  Revision  Changes    Path
  1.23      +15 -0     
xml-axis/java/src/org/apache/axis/configuration/FileProvider.java
  
  Index: FileProvider.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/configuration/FileProvider.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- FileProvider.java 22 Feb 2002 23:39:43 -0000      1.22
  +++ FileProvider.java 27 Feb 2002 14:54:27 -0000      1.23
  @@ -67,6 +67,7 @@
   import org.apache.axis.utils.Admin;
   import org.apache.axis.utils.XMLUtils;
   import org.apache.axis.utils.JavaUtils;
  +import org.apache.axis.InternalException;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.w3c.dom.Document;
  @@ -84,6 +85,7 @@
    * write XML files.
    *
    * @author Glen Daniels ([EMAIL PROTECTED])
  + * @author Glyn Normington ([EMAIL PROTECTED])
    */
   public class FileProvider implements EngineConfiguration {
       protected static Log log =
  @@ -120,6 +122,19 @@
       public FileProvider(String basepath, String filename) {
           this.basepath = basepath;
           this.filename = filename;
  +
  +        File dir = new File(basepath);
  +
  +        /*
  +         * If the basepath is not a readable directory, throw an internal
  +         * exception to make it easier to debug setup problems.
  +         */
  +        if (!dir.isDirectory() || !dir.canRead()) {
  +            throw new InternalException(JavaUtils.
  +                                        getMessage("invalidConfigFilePath",
  +                                                   basepath));
  +        }
  +
           File file = new File(basepath, filename);
           readOnly = file.canRead() & !file.canWrite();
   
  
  
  


Reply via email to