@Test public void testAppendTrailingSlash() { URI withTrailingSlash = URI.create("http: URI withoutTrailingSlash = URI.create("http: URI resultUnchanged = HttpUtils.appendTrailingSlash(withTrailingSlash); URI resultSlashAdded = HttpUtils.appendTrailingSlash(withoutTrailingSlash); Assert.assertEquals(withTrailingSlash, resultUnchanged); Assert.assertEquals(withTrailingSlash, resultSlashAdded); }
public static URI appendTrailingSlash(URI uri) { String uriString = uri.toString(); if (uriString.matches(".*/$")) { return uri; } else return URI.create(uriString + "/"); }
HttpUtils { public static URI appendTrailingSlash(URI uri) { String uriString = uri.toString(); if (uriString.matches(".*/$")) { return uri; } else return URI.create(uriString + "/"); } }
HttpUtils { public static URI appendTrailingSlash(URI uri) { String uriString = uri.toString(); if (uriString.matches(".*/$")) { return uri; } else return URI.create(uriString + "/"); } private  HttpUtils(); }
HttpUtils { public static URI appendTrailingSlash(URI uri) { String uriString = uri.toString(); if (uriString.matches(".*/$")) { return uri; } else return URI.create(uriString + "/"); } private  HttpUtils(); static String readUrl(URL url, String charsetName); static URI appendTrailingSlash(URI uri); static URI getSanitizedPath(UriInfo uriInfo); static URI getDirectoryURI(UriInfo uriInfo); }
HttpUtils { public static URI appendTrailingSlash(URI uri) { String uriString = uri.toString(); if (uriString.matches(".*/$")) { return uri; } else return URI.create(uriString + "/"); } private  HttpUtils(); static String readUrl(URL url, String charsetName); static URI appendTrailingSlash(URI uri); static URI getSanitizedPath(UriInfo uriInfo); static URI getDirectoryURI(UriInfo uriInfo);  }