public Document parse(File f) throws SAXException, IOException {
        if (f == null) {
            throw new IllegalArgumentException("File cannot be null");
        }

        String escapedURI = FilePathToURI.filepath2URI(f.getAbsolutePath());

        if (DEBUG) {
            System.out.println("Escaped URI = " + escapedURI);
        }

        InputSource in = new InputSource(escapedURI);
        return parse(in);
    }
public Document parse ( File f ) throws SAXException , IOException { if ( f == null ) { throw new IllegalArgumentException ( "File cannot be null" ) ; } String escapedURI = FilePathToURI . filepath2URI ( f . getAbsolutePath ( ) ) ; if ( DEBUG ) { System . out . println ( "Escaped URI = " + escapedURI ) ; } InputSource in = new InputSource ( escapedURI ) ; return parse ( in ) ; }
Parse the content of the given file as an XML document
and return a new DOM {@link Document} object.
An <code>IllegalArgumentException</code> is thrown if the
<code>File</code> is <code>null</code> null.

@param f The file containing the XML to parse.
@exception IOException If any IO errors occur.
@exception SAXException If any parse errors occur.
@see org.xml.sax.DocumentHandler
@return A new DOM Document object.