@Test public void httpsPorts() { assertThat(removeDefaultHttpPorts("https: assertThat(removeDefaultHttpPorts("https: assertThat(removeDefaultHttpPorts("https: assertThat(removeDefaultHttpPorts("localhost/auth")).isNull(); }
public static String removeDefaultHttpPorts(final String uri) { URL url; try { url = new URL(uri); if (url.getPort() == url.getDefaultPort()) { String urlPort = ":" + url.getPort(); return url.toExternalForm().replace(urlPort, ""); } } catch (MalformedURLException e) { return null; } return url.toExternalForm(); }
CommonUtils { public static String removeDefaultHttpPorts(final String uri) { URL url; try { url = new URL(uri); if (url.getPort() == url.getDefaultPort()) { String urlPort = ":" + url.getPort(); return url.toExternalForm().replace(urlPort, ""); } } catch (MalformedURLException e) { return null; } return url.toExternalForm(); } }
CommonUtils { public static String removeDefaultHttpPorts(final String uri) { URL url; try { url = new URL(uri); if (url.getPort() == url.getDefaultPort()) { String urlPort = ":" + url.getPort(); return url.toExternalForm().replace(urlPort, ""); } } catch (MalformedURLException e) { return null; } return url.toExternalForm(); } private  CommonUtils(); }
CommonUtils { public static String removeDefaultHttpPorts(final String uri) { URL url; try { url = new URL(uri); if (url.getPort() == url.getDefaultPort()) { String urlPort = ":" + url.getPort(); return url.toExternalForm().replace(urlPort, ""); } } catch (MalformedURLException e) { return null; } return url.toExternalForm(); } private  CommonUtils(); static Boolean isAscendingOrder(String sorting); static String removeDefaultHttpPorts(final String uri); }
CommonUtils { public static String removeDefaultHttpPorts(final String uri) { URL url; try { url = new URL(uri); if (url.getPort() == url.getDefaultPort()) { String urlPort = ":" + url.getPort(); return url.toExternalForm().replace(urlPort, ""); } } catch (MalformedURLException e) { return null; } return url.toExternalForm(); } private  CommonUtils(); static Boolean isAscendingOrder(String sorting); static String removeDefaultHttpPorts(final String uri);  }