You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by to...@apache.org on 2004/01/20 18:07:33 UTC

cvs commit: ws-axis/java/src/org/apache/axis/handlers JWSHandler.java

tomj        2004/01/20 09:07:33

  Modified:    java/src/org/apache/axis/handlers JWSHandler.java
  Log:
  Fix up JWS error message to avoid using an absolute path.
  
  Revision  Changes    Path
  1.39      +11 -3     ws-axis/java/src/org/apache/axis/handlers/JWSHandler.java
  
  Index: JWSHandler.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/handlers/JWSHandler.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- JWSHandler.java	30 Nov 2003 23:00:39 -0000	1.38
  +++ JWSHandler.java	20 Jan 2004 17:07:33 -0000	1.39
  @@ -61,6 +61,7 @@
   import java.io.FileWriter;
   import java.io.IOException;
   import java.io.InputStream;
  +import java.io.FileNotFoundException;
   import java.net.URL;
   import java.net.URLClassLoader;
   import java.net.URLDecoder;
  @@ -145,10 +146,18 @@
               /***************************************************************/
               String   jwsFile = realpath;
               String rel = msgContext.getStrProp(Constants.MC_RELATIVE_PATH);
  +
  +            // Check for file existance, report error with
  +            // relative path to avoid giving out directory info.
  +            File  f2 = new File( jwsFile );
  +            if (!f2.exists()) {
  +                throw new FileNotFoundException(rel);
  +            }
  +
               if (rel.charAt(0) == '/') {
                   rel = rel.substring(1);
               }
  -            
  +
               int lastSlash = rel.lastIndexOf('/');
               String dir = null;
               
  @@ -194,8 +203,7 @@
               }
               
               File  f1 = new File( cFile );
  -            File  f2 = new File( jwsFile );
  -            
  +
               /* Get the class */
               /*****************/
               String clsName = null ;