Skip to content

Commit 5fdde6c

Browse files
committed
add method to encode path parameters
1 parent cabe1e5 commit 5fdde6c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/ApiMethod.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,4 +402,13 @@ public ApiHttpResponse<byte[]> sendBlocking() {
402402
public ApiHttpResponse<byte[]> sendBlocking(final Duration timeout) {
403403
return apiHttpClient.sendBlocking(this, timeout);
404404
}
405+
406+
protected static <V> String encodePathParam(V pathParameter) {
407+
try {
408+
return URLEncoder.encode(pathParameter.toString(), StandardCharsets.UTF_8.toString());
409+
}
410+
catch (UnsupportedEncodingException e) {
411+
throw new EncodingException(e);
412+
}
413+
}
405414
}

0 commit comments

Comments
 (0)