Java Code Examples for org.apache.flink.shaded.netty4.io.netty.handler.codec.http.QueryStringDecoder#decodeComponent()

The following examples show how to use org.apache.flink.shaded.netty4.io.netty.handler.codec.http.QueryStringDecoder#decodeComponent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Router.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
private String[] decodePathTokens(String uri) {
	// Need to split the original URI (instead of QueryStringDecoder#path) then decode the tokens (components),
	// otherwise /test1/123%2F456 will not match /test1/:p1

	int qPos = uri.indexOf("?");
	String encodedPath = (qPos >= 0) ? uri.substring(0, qPos) : uri;

	String[] encodedTokens = PathPattern.removeSlashesAtBothEnds(encodedPath).split("/");

	String[] decodedTokens = new String[encodedTokens.length];
	for (int i = 0; i < encodedTokens.length; i++) {
		String encodedToken = encodedTokens[i];
		decodedTokens[i] = QueryStringDecoder.decodeComponent(encodedToken);
	}

	return decodedTokens;
}
 
Example 2
Source File: Router.java    From flink with Apache License 2.0 6 votes vote down vote up
private String[] decodePathTokens(String uri) {
	// Need to split the original URI (instead of QueryStringDecoder#path) then decode the tokens (components),
	// otherwise /test1/123%2F456 will not match /test1/:p1

	int qPos = uri.indexOf("?");
	String encodedPath = (qPos >= 0) ? uri.substring(0, qPos) : uri;

	String[] encodedTokens = PathPattern.removeSlashesAtBothEnds(encodedPath).split("/");

	String[] decodedTokens = new String[encodedTokens.length];
	for (int i = 0; i < encodedTokens.length; i++) {
		String encodedToken = encodedTokens[i];
		decodedTokens[i] = QueryStringDecoder.decodeComponent(encodedToken);
	}

	return decodedTokens;
}
 
Example 3
Source File: Router.java    From flink with Apache License 2.0 6 votes vote down vote up
private String[] decodePathTokens(String uri) {
	// Need to split the original URI (instead of QueryStringDecoder#path) then decode the tokens (components),
	// otherwise /test1/123%2F456 will not match /test1/:p1

	int qPos = uri.indexOf("?");
	String encodedPath = (qPos >= 0) ? uri.substring(0, qPos) : uri;

	String[] encodedTokens = PathPattern.removeSlashesAtBothEnds(encodedPath).split("/");

	String[] decodedTokens = new String[encodedTokens.length];
	for (int i = 0; i < encodedTokens.length; i++) {
		String encodedToken = encodedTokens[i];
		decodedTokens[i] = QueryStringDecoder.decodeComponent(encodedToken);
	}

	return decodedTokens;
}