@UseDataProvider("forNormalizesUri") @Test public void normalizesUri(String originUri, String normalizedUri) throws Exception { assertEquals(normalizedUri, UriComponent.normalize(URI.create(originUri)).toString()); }
public static URI normalize(URI uri) { String oldPath = uri.getRawPath(); if (Strings.isNullOrEmpty(oldPath)) { return uri; } String normalizedPath = normalize(oldPath); if (normalizedPath.equals(oldPath)) { return uri; } return UriBuilder.fromUri(uri).replacePath(normalizedPath).build(); }
UriComponent { public static URI normalize(URI uri) { String oldPath = uri.getRawPath(); if (Strings.isNullOrEmpty(oldPath)) { return uri; } String normalizedPath = normalize(oldPath); if (normalizedPath.equals(oldPath)) { return uri; } return UriBuilder.fromUri(uri).replacePath(normalizedPath).build(); } }
UriComponent { public static URI normalize(URI uri) { String oldPath = uri.getRawPath(); if (Strings.isNullOrEmpty(oldPath)) { return uri; } String normalizedPath = normalize(oldPath); if (normalizedPath.equals(oldPath)) { return uri; } return UriBuilder.fromUri(uri).replacePath(normalizedPath).build(); } private  UriComponent(); }
UriComponent { public static URI normalize(URI uri) { String oldPath = uri.getRawPath(); if (Strings.isNullOrEmpty(oldPath)) { return uri; } String normalizedPath = normalize(oldPath); if (normalizedPath.equals(oldPath)) { return uri; } return UriBuilder.fromUri(uri).replacePath(normalizedPath).build(); } private  UriComponent(); static URI normalize(URI uri); static String encode(String str, int component, boolean containsUriParams); static String validateUriComponent(String str, int component, boolean containsUriParams); static boolean isUriComponentContainsValidCharacters(int component, String str); static String recognizeEncode(String str, int component, boolean containsUriParams); static String decode(String str, int component); static boolean checkHexCharacters(String s, int p); static List<PathSegment> parsePathSegments(String path, boolean decode); static MultivaluedMap<String, String> parseQueryString(String rawQuery, boolean decode); static URI resolve(URI baseUri, URI resolvingUri); }
UriComponent { public static URI normalize(URI uri) { String oldPath = uri.getRawPath(); if (Strings.isNullOrEmpty(oldPath)) { return uri; } String normalizedPath = normalize(oldPath); if (normalizedPath.equals(oldPath)) { return uri; } return UriBuilder.fromUri(uri).replacePath(normalizedPath).build(); } private  UriComponent(); static URI normalize(URI uri); static String encode(String str, int component, boolean containsUriParams); static String validateUriComponent(String str, int component, boolean containsUriParams); static boolean isUriComponentContainsValidCharacters(int component, String str); static String recognizeEncode(String str, int component, boolean containsUriParams); static String decode(String str, int component); static boolean checkHexCharacters(String s, int p); static List<PathSegment> parsePathSegments(String path, boolean decode); static MultivaluedMap<String, String> parseQueryString(String rawQuery, boolean decode); static URI resolve(URI baseUri, URI resolvingUri); static final int SCHEME; static final int USER_INFO; static final int HOST; static final int PORT; static final int PATH_SEGMENT; static final int PATH; static final int QUERY; static final int FRAGMENT; static final int SSP; static final int MATRIX_PARAM; static final int QUERY_STRING; static final String PERCENT; }