summaryrefslogtreecommitdiffstats
path: root/vespaclient-container-plugin
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@gmail.com>2022-04-06 10:41:25 +0200
committerJon Marius Venstad <jonmv@gmail.com>2022-04-06 10:41:25 +0200
commit97707f39eb5c759ff331ca5db3982e93864bf666 (patch)
tree5e20468a23e6f285acf41ba321535c2ea4412852 /vespaclient-container-plugin
parent4938d05b5d4c116b5860c118f9e3873355e0f48c (diff)
Remove usage of asString() and remove it from Path
Diffstat (limited to 'vespaclient-container-plugin')
-rw-r--r--vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java
index 7b3e488a5a5..860ce5e9bc4 100644
--- a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java
+++ b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java
@@ -241,7 +241,7 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler {
if (requestPath.matches(path)) {
Map<Method, Handler> methods = handlers.get(path);
if (methods.containsKey(request.getMethod()))
- return methods.get(request.getMethod()).handle(request, new DocumentPath(requestPath), responseHandler);
+ return methods.get(request.getMethod()).handle(request, new DocumentPath(requestPath, request.getUri().getRawPath()), responseHandler);
if (request.getMethod() == OPTIONS)
options(methods.keySet(), responseHandler);
@@ -1458,10 +1458,12 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler {
private static class DocumentPath {
private final Path path;
+ private final String rawPath;
private final Optional<Group> group;
- DocumentPath(Path path) {
+ DocumentPath(Path path, String rawPath) {
this.path = requireNonNull(path);
+ this.rawPath = requireNonNull(rawPath);
this.group = Optional.ofNullable(path.get("number")).map(unsignedLongParser::parse).map(Group::of)
.or(() -> Optional.ofNullable(path.get("group")).map(Group::of));
}
@@ -1473,7 +1475,7 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler {
":" + requireNonNull(path.getRest()));
}
- String rawPath() { return path.asString(); }
+ String rawPath() { return rawPath; }
Optional<String> documentType() { return Optional.ofNullable(path.get("documentType")); }
Optional<String> namespace() { return Optional.ofNullable(path.get("namespace")); }
Optional<Group> group() { return group; }