HttpOperations extends ChannelOperations<INBOUND, OUTBOUND> implements HttpInfos { public static String resolvePath(String uri) { Objects.requireNonNull(uri, "uri"); if (uri.isEmpty()) { return uri; } String tempUri = uri; if (tempUri.charAt(0) == '/') { tempUri = "http: } else if (!SCHEME_PATTERN.matcher(tempUri).matches()) { tempUri = "http: } return URI.create(tempUri) .getPath(); } protected  HttpOperations(HttpOperations<INBOUND, OUTBOUND> replaced); protected  HttpOperations(Connection connection, ConnectionObserver listener); final boolean hasSentHeaders(); @Override boolean isWebsocket(); @Override @SuppressWarnings("unchecked") NettyOutbound send(Publisher<? extends ByteBuf> source); @Override NettyOutbound sendObject(Object message); @Override Mono<Void> then(); @Override final NettyOutbound sendFile(Path file, long position, long count); @Override String toString(); @Override HttpOperations<INBOUND, OUTBOUND> addHandler(String name, ChannelHandler handler); static String resolvePath(String uri);  }
@Test public void testFullPath() { assertEquals("", HttpOperations.resolvePath("http: assertEquals("/", HttpOperations.resolvePath("http: assertEquals(" assertEquals(" assertEquals("/a", HttpOperations.resolvePath("http: assertEquals("/a/", HttpOperations.resolvePath("http: assertEquals("/", HttpOperations.resolvePath("http: assertEquals("/a", HttpOperations.resolvePath("http: assertEquals("/", HttpOperations.resolvePath("http: assertEquals("/a", HttpOperations.resolvePath("http: assertEquals("/a", HttpOperations.resolvePath("http: assertEquals("/a b", HttpOperations.resolvePath("http: assertEquals("", HttpOperations.resolvePath("localhost:8080")); assertEquals("/", HttpOperations.resolvePath("localhost:8080/")); assertEquals(" assertEquals(" assertEquals("/a", HttpOperations.resolvePath("localhost:8080/a")); assertEquals("/a/", HttpOperations.resolvePath("localhost:8080/a/")); assertEquals("/", HttpOperations.resolvePath("localhost:8080/?b")); assertEquals("/a", HttpOperations.resolvePath("localhost:8080/a?b")); assertEquals("/", HttpOperations.resolvePath("localhost:8080/#b")); assertEquals("/a", HttpOperations.resolvePath("localhost:8080/a#b")); assertEquals("/a", HttpOperations.resolvePath("localhost:8080/a?b#c")); assertEquals("/a b", HttpOperations.resolvePath("localhost:8080/a%20b")); assertEquals("", HttpOperations.resolvePath("")); assertEquals("/", HttpOperations.resolvePath("/")); assertEquals(" assertEquals(" assertEquals("/a", HttpOperations.resolvePath("/a")); assertEquals("/a/", HttpOperations.resolvePath("/a/")); assertEquals("/", HttpOperations.resolvePath("/?b")); assertEquals("/a", HttpOperations.resolvePath("/a?b")); assertEquals("/", HttpOperations.resolvePath("/#b")); assertEquals("/a", HttpOperations.resolvePath("/a#b")); assertEquals("/a", HttpOperations.resolvePath("/a?b#c")); assertEquals("/a b", HttpOperations.resolvePath("/a%20b")); }