public File findFile ( String path ) throws IOException { File base = new File ( getBasePath ( ) ) ; File pathFile = new File ( base , "." + path ) ; if ( ! pathFile . exists ( ) ) throw new FileNotFoundException ( "No file or directory at " + pathFile . getCanonicalPath ( ) ) ; if ( pathFile . isFile ( ) ) return pathFile ; pathFile = new File ( pathFile , "index.html" ) ; if ( ! pathFile . exists ( ) ) throw new FileNotFoundException ( "No welcome file at " + pathFile . getCanonicalPath ( ) ) ; return pathFile ; }
Returns the file object for the given path including welcome file lookup . If the file cannot be found a FileNotFoundException is returned .