private static URL buildUrlWithNewPath(URL url, final String newPath) { try { url = UrlUtils.getUrlWithNewPath(url, newPath); } catch (final Exception e) { throw new RuntimeException("Cannot change path of URL: " + url.toExternalForm(), e); } return url; }
private static URL buildUrlWithNewPath(URL url, final String newPath) { try { url = UrlUtils.getUrlWithNewPath(url, newPath); } catch (final Exception e) { throw new RuntimeException("Cannot change path of URL: " + url.toExternalForm(), e); } return url; }
/** * Sets the pathname portion of the link's URL. * @param pathname the new pathname portion of the link's URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534332.aspx">MSDN Documentation</a> */ public void jsxSet_pathname(final String pathname) throws Exception { setUrl(UrlUtils.getUrlWithNewPath(getUrl(), pathname)); }
/** * Sets the pathname portion of the link's URL. * @param pathname the new pathname portion of the link's URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534332.aspx">MSDN Documentation</a> */ public void jsxSet_pathname(final String pathname) throws Exception { setUrl(UrlUtils.getUrlWithNewPath(getUrl(), pathname)); }
/** * Sets the pathname portion of the location URL. * @param pathname the new pathname portion of the location URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534332.aspx">MSDN Documentation</a> */ public void jsxSet_pathname(final String pathname) throws Exception { setUrl(UrlUtils.getUrlWithNewPath(getUrl(), pathname)); }
/** * Sets the pathname portion of the location URL. * @param pathname the new pathname portion of the location URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534332.aspx">MSDN Documentation</a> */ public void jsxSet_pathname(final String pathname) throws Exception { setUrl(UrlUtils.getUrlWithNewPath(getUrl(), pathname)); }
/** * Sets the pathname portion of the location URL. * @param pathname the new pathname portion of the location URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534332.aspx">MSDN Documentation</a> */ public void jsxSet_pathname(final String pathname) throws Exception { setUrl(UrlUtils.getUrlWithNewPath(getUrl(), pathname)); }
/** * Sets the pathname portion of the link's URL. * @param pathname the new pathname portion of the link's URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534332.aspx">MSDN Documentation</a> */ public void jsxSet_pathname(final String pathname) throws Exception { setUrl(UrlUtils.getUrlWithNewPath(getUrl(), pathname)); }
/** * Sets the pathname portion of the link's URL. * @param pathname the new pathname portion of the link's URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534332.aspx">MSDN Documentation</a> */ @JsxSetter public void setPathname(final String pathname) throws Exception { setUrl(UrlUtils.getUrlWithNewPath(getUrl(), pathname)); }
/** * Sets the pathname portion of the location URL. * @param pathname the new pathname portion of the location URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534332.aspx">MSDN Documentation</a> */ @JsxSetter public void setPathname(final String pathname) throws Exception { setUrl(UrlUtils.getUrlWithNewPath(getUrl(), pathname)); }
/** * Sets the pathname portion of the link's URL. * @param pathname the new pathname portion of the link's URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534332.aspx">MSDN Documentation</a> */ @JsxSetter public void setPathname(final String pathname) throws Exception { setUrl(UrlUtils.getUrlWithNewPath(getUrl(), pathname)); }
/** * Sets the pathname portion of the location URL. * @param pathname the new pathname portion of the location URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534332.aspx">MSDN Documentation</a> */ @JsxSetter public void setPathname(final String pathname) throws Exception { setUrl(UrlUtils.getUrlWithNewPath(getUrl(), pathname)); }
/** * <span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span><br> * * @param href the href * @param page the HtmlPage * @return the calculated target url. * @throws MalformedURLException if an IO error occurs */ public static URL getTargetUrl(final String href, final HtmlPage page) throws MalformedURLException { URL url = page.getFullyQualifiedUrl(href); // fix for empty url if (StringUtils.isEmpty(href)) { final boolean dropFilename = page.getWebClient().getBrowserVersion() .hasFeature(ANCHOR_EMPTY_HREF_NO_FILENAME); if (dropFilename) { String path = url.getPath(); path = path.substring(0, path.lastIndexOf('/') + 1); url = UrlUtils.getUrlWithNewPath(url, path); url = UrlUtils.getUrlWithNewRef(url, null); } else { url = UrlUtils.getUrlWithNewRef(url, null); } } return url; }
/** * <span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span><br> * * @param href the href * @param page the HtmlPage * @return the calculated target url. * @throws MalformedURLException if an IO error occurs */ public static URL getTargetUrl(final String href, final HtmlPage page) throws MalformedURLException { URL url = page.getFullyQualifiedUrl(href); // fix for empty url if (StringUtils.isEmpty(href)) { final boolean dropFilename = page.getWebClient().getBrowserVersion() .hasFeature(ANCHOR_EMPTY_HREF_NO_FILENAME); if (dropFilename) { String path = url.getPath(); path = path.substring(0, path.lastIndexOf('/') + 1); url = UrlUtils.getUrlWithNewPath(url, path); url = UrlUtils.getUrlWithNewRef(url, null); } else { url = UrlUtils.getUrlWithNewRef(url, null); } } return url; }
String path = url.getPath(); path = path.substring(0, path.lastIndexOf('/') + 1); url = UrlUtils.getUrlWithNewPath(url, path); url = UrlUtils.getUrlWithNewRef(url, null);
String path = url.getPath(); path = path.substring(0, path.lastIndexOf('/') + 1); url = UrlUtils.getUrlWithNewPath(url, path); url = UrlUtils.getUrlWithNewRef(url, null);