private void locateUriRoot(File f){
  String tUriBase=uriBase;
  if (tUriBase == null) {
    tUriBase="/";
  }
  try {
    if (f.exists()) {
      f=new File(f.getCanonicalPath());
      while (f != null) {
        File g=new File(f,"WEB-INF");
        if (g.exists() && g.isDirectory()) {
          uriRoot=f.getCanonicalPath();
          uriBase=tUriBase;
          if (log.isLoggable(Level.INFO)) {
            log.info(Localizer.getMessage("jspc.implicit.uriRoot",uriRoot));
          }
          break;
        }
        if (f.exists() && f.isDirectory()) {
          tUriBase="/" + f.getName() + "/"+ tUriBase;
        }
        String fParent=f.getParent();
        if (fParent == null) {
          break;
        }
 else {
          f=new File(fParent);
        }
      }
      if (uriRoot != null) {
        File froot=new File(uriRoot);
        uriRoot=froot.getCanonicalPath();
      }
    }
  }
 catch (  IOException ioe) {
  }
}

private void locateUriRoot ( File f ) { String tUriBase = uriBase ; if ( tUriBase == null ) { tUriBase = "/" ; } try { if ( f . exists ( ) ) { f = new File ( f . getCanonicalPath ( ) ) ; while ( f != null ) { File g = new File ( f , "WEB-INF" ) ; if ( g . exists ( ) && g . isDirectory ( ) ) { uriRoot = f . getCanonicalPath ( ) ; uriBase = tUriBase ; if ( log . isLoggable ( Level . INFO ) ) { log . info ( Localizer . getMessage ( "jspc.implicit.uriRoot" , uriRoot ) ) ; } break ; } if ( f . exists ( ) && f . isDirectory ( ) ) { tUriBase = "/" + f . getName ( ) + "/" + tUriBase ; } String fParent = f . getParent ( ) ; if ( fParent == null ) { break ; } else { f = new File ( fParent ) ; } } if ( uriRoot != null ) { File froot = new File ( uriRoot ) ; uriRoot = froot . getCanonicalPath ( ) ; } } } catch ( IOException ioe ) { } }
find the web - inf dir by looking up in the directory tree . this is used if no explicit docbase is set , but only files . xxx maybe we should require the docbase .
