/** * Sets the port portion of the location URL. * @param port the new port portion of the location URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534342.aspx">MSDN Documentation</a> */ public void jsxSet_port(final String port) throws Exception { setUrl(UrlUtils.getUrlWithNewPort(getUrl(), Integer.parseInt(port))); }
/** * {@link CookieSpec#match(String, int, String, boolean, Cookie[])} doesn't like empty hosts and * negative ports, but these things happen if we're dealing with a local file. This method * allows us to work around this limitation in HttpClient by feeding it a bogus host and port. * * @param url the URL to replace if necessary * @return the replacement URL, or the original URL if no replacement was necessary */ private static URL replaceForCookieIfNecessary(URL url) { final String protocol = url.getProtocol(); final boolean file = "file".equals(protocol); if (file) { try { url = getUrlWithNewPort(getUrlWithNewHost(url, "LOCAL_FILESYSTEM"), 0); } catch (final MalformedURLException e) { throw new RuntimeException(e); } } return url; }
/** * {@link CookieSpec#match(String, int, String, boolean, Cookie[])} doesn't like empty hosts and * negative ports, but these things happen if we're dealing with a local file. This method * allows us to work around this limitation in HttpClient by feeding it a bogus host and port. * * @param url the URL to replace if necessary * @return the replacement URL, or the original URL if no replacement was necessary */ private static URL replaceForCookieIfNecessary(URL url) { final String protocol = url.getProtocol(); final boolean file = "file".equals(protocol); if (file) { try { url = getUrlWithNewPort(getUrlWithNewHost(url, "LOCAL_FILESYSTEM"), 0); } catch (final MalformedURLException e) { throw new RuntimeException(e); } } return url; }
/** * {@link CookieSpec#match(String, int, String, boolean, Cookie[])} doesn't like empty hosts and * negative ports, but these things happen if we're dealing with a local file. This method * allows us to work around this limitation in HttpClient by feeding it a bogus host and port. * * @param url the URL to replace if necessary * @return the replacement URL, or the original URL if no replacement was necessary */ private static URL replaceForCookieIfNecessary(URL url) { final String protocol = url.getProtocol(); final boolean file = "file".equals(protocol); if (file) { try { url = getUrlWithNewPort(getUrlWithNewHost(url, "LOCAL_FILESYSTEM"), 0); } catch (final MalformedURLException e) { throw new RuntimeException(e); } } return url; }
/** * Sets the port portion of the location URL. * @param port the new port portion of the location URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534342.aspx">MSDN Documentation</a> */ public void jsxSet_port(final String port) throws Exception { setUrl(UrlUtils.getUrlWithNewPort(getUrl(), Integer.parseInt(port))); }
/** * Sets the port portion of the location URL. * @param port the new port portion of the location URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534342.aspx">MSDN Documentation</a> */ public void jsxSet_port(final String port) throws Exception { setUrl(UrlUtils.getUrlWithNewPort(getUrl(), Integer.parseInt(port))); }
/** * Sets the port portion of the link's URL. * @param port the new port portion of the link's URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534342.aspx">MSDN Documentation</a> */ public void jsxSet_port(final String port) throws Exception { setUrl(UrlUtils.getUrlWithNewPort(getUrl(), Integer.parseInt(port))); }
/** * Sets the port portion of the link's URL. * @param port the new port portion of the link's URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534342.aspx">MSDN Documentation</a> */ public void jsxSet_port(final String port) throws Exception { setUrl(UrlUtils.getUrlWithNewPort(getUrl(), Integer.parseInt(port))); }
/** * Sets the port portion of the link's URL. * @param port the new port portion of the link's URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534342.aspx">MSDN Documentation</a> */ public void jsxSet_port(final String port) throws Exception { setUrl(UrlUtils.getUrlWithNewPort(getUrl(), Integer.parseInt(port))); }
/** * Sets the port portion of the location URL. * @param port the new port portion of the location URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534342.aspx">MSDN Documentation</a> */ @JsxSetter public void setPort(final String port) throws Exception { setUrl(UrlUtils.getUrlWithNewPort(getUrl(), Integer.parseInt(port))); }
/** * Sets the port portion of the link's URL. * @param port the new port portion of the link's URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534342.aspx">MSDN Documentation</a> */ @JsxSetter public void setPort(final String port) throws Exception { setUrl(UrlUtils.getUrlWithNewPort(getUrl(), Integer.parseInt(port))); }
/** * Sets the port portion of the link's URL. * @param port the new port portion of the link's URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534342.aspx">MSDN Documentation</a> */ @JsxSetter public void setPort(final String port) throws Exception { setUrl(UrlUtils.getUrlWithNewPort(getUrl(), Integer.parseInt(port))); }
/** * Sets the host portion of the link's URL (the '[hostname]:[port]' portion). * @param host the new host portion of the link's URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms533784.aspx">MSDN Documentation</a> */ public void jsxSet_host(final String host) throws Exception { final String hostname; final int port; final int index = host.indexOf(':'); if (index != -1) { hostname = host.substring(0, index); port = Integer.parseInt(host.substring(index + 1)); } else { hostname = host; port = -1; } final URL url1 = UrlUtils.getUrlWithNewHost(getUrl(), hostname); final URL url2 = UrlUtils.getUrlWithNewPort(url1, port); setUrl(url2); }
/** * Sets the port portion of the location URL. * @param port the new port portion of the location URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms534342.aspx">MSDN Documentation</a> */ @JsxSetter public void setPort(final String port) throws Exception { setUrl(UrlUtils.getUrlWithNewPort(getUrl(), Integer.parseInt(port))); }
/** * Sets the host portion of the link's URL (the '[hostname]:[port]' portion). * @param host the new host portion of the link's URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms533784.aspx">MSDN Documentation</a> */ public void jsxSet_host(final String host) throws Exception { final String hostname; final int port; final int index = host.indexOf(':'); if (index != -1) { hostname = host.substring(0, index); port = Integer.parseInt(host.substring(index + 1)); } else { hostname = host; port = -1; } final URL url1 = UrlUtils.getUrlWithNewHost(getUrl(), hostname); final URL url2 = UrlUtils.getUrlWithNewPort(url1, port); setUrl(url2); }
/** * Sets the host portion of the location URL (the '[hostname]:[port]' portion). * @param host the new host portion of the location URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms533784.aspx">MSDN Documentation</a> */ public void jsxSet_host(final String host) throws Exception { final String hostname; final int port; final int index = host.indexOf(':'); if (index != -1) { hostname = host.substring(0, index); port = Integer.parseInt(host.substring(index + 1)); } else { hostname = host; port = -1; } final URL url1 = UrlUtils.getUrlWithNewHost(getUrl(), hostname); final URL url2 = UrlUtils.getUrlWithNewPort(url1, port); setUrl(url2); }
/** * Sets the host portion of the location URL (the '[hostname]:[port]' portion). * @param host the new host portion of the location URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms533784.aspx">MSDN Documentation</a> */ public void jsxSet_host(final String host) throws Exception { final String hostname; final int port; final int index = host.indexOf(':'); if (index != -1) { hostname = host.substring(0, index); port = Integer.parseInt(host.substring(index + 1)); } else { hostname = host; port = -1; } final URL url1 = UrlUtils.getUrlWithNewHost(getUrl(), hostname); final URL url2 = UrlUtils.getUrlWithNewPort(url1, port); setUrl(url2); }
/** * Sets the host portion of the link's URL (the '[hostname]:[port]' portion). * @param host the new host portion of the link's URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms533784.aspx">MSDN Documentation</a> */ public void jsxSet_host(final String host) throws Exception { final String hostname; final int port; final int index = host.indexOf(':'); if (index != -1) { hostname = host.substring(0, index); port = Integer.parseInt(host.substring(index + 1)); } else { hostname = host; port = -1; } final URL url1 = UrlUtils.getUrlWithNewHost(getUrl(), hostname); final URL url2 = UrlUtils.getUrlWithNewPort(url1, port); setUrl(url2); }
/** * Sets the host portion of the location URL (the '[hostname]:[port]' portion). * @param host the new host portion of the location URL * @throws Exception if an error occurs * @see <a href="http://msdn.microsoft.com/en-us/library/ms533784.aspx">MSDN Documentation</a> */ public void jsxSet_host(final String host) throws Exception { final String hostname; final int port; final int index = host.indexOf(':'); if (index != -1) { hostname = host.substring(0, index); port = Integer.parseInt(host.substring(index + 1)); } else { hostname = host; port = -1; } final URL url1 = UrlUtils.getUrlWithNewHost(getUrl(), hostname); final URL url2 = UrlUtils.getUrlWithNewPort(url1, port); setUrl(url2); }