/** * Loads and renders a Document given a uri. * The uri is resolved by the UserAgentCallback * * @param uri */ public void setDocument(String uri) { setDocument(loadDocument(uri), uri); }
/** * Loads and renders a Document given a uri. * The uri is resolved by the UserAgentCallback * * @param uri */ public void setDocument(String uri) { setDocument(loadDocument(uri), uri); }
/** * Renders a Document read from an InputStream using a URL * as a base URL for relative paths. * * @param file The file to read the Document from. Relative paths * will be resolved based on the file's parent directory. */ // TODO: should throw more specific exception (PWW 25/07/2006) public void setDocument(File file) throws Exception { resetListeners(); File parent = file.getAbsoluteFile().getParentFile(); String parentURL = ( parent == null ? "" : parent.toURI().toURL().toExternalForm()); setDocument( loadDocument(file.toURI().toURL().toExternalForm()), parentURL ); }
/** * Renders a Document read from an InputStream using a URL * as a base URL for relative paths. * * @param file The file to read the Document from. Relative paths * will be resolved based on the file's parent directory. */ // TODO: should throw more specific exception (PWW 25/07/2006) public void setDocument(File file) throws Exception { resetListeners(); File parent = file.getAbsoluteFile().getParentFile(); String parentURL = ( parent == null ? "" : parent.toURI().toURL().toExternalForm()); setDocument( loadDocument(file.toURI().toURL().toExternalForm()), parentURL ); }