2 * Copyright (c) 2017 Inocybe Technologies and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.restconf.nb.rfc8040.rests.services.impl;
11 import java.util.List;
12 import javax.ws.rs.core.MultivaluedHashMap;
13 import javax.ws.rs.core.MultivaluedMap;
14 import javax.ws.rs.core.PathSegment;
15 import javax.ws.rs.core.UriBuilder;
16 import javax.ws.rs.core.UriInfo;
19 * Simple implementation of the {@link UriInfo} interface.
21 * @author Thomas Pantelis
23 final class LocalUriInfo implements UriInfo {
24 private final MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<>();
25 private final String path;
32 public String getPath() {
37 public String getPath(final boolean decode) {
42 public List<PathSegment> getPathSegments() {
43 throw new UnsupportedOperationException();
47 public List<PathSegment> getPathSegments(final boolean decode) {
48 throw new UnsupportedOperationException();
52 public URI getRequestUri() {
53 return URI.create(path);
57 public UriBuilder getRequestUriBuilder() {
58 return UriBuilder.fromUri(getRequestUri());
62 public URI getAbsolutePath() {
63 return getRequestUri();
67 public UriBuilder getAbsolutePathBuilder() {
68 return UriBuilder.fromUri(getAbsolutePath());
72 public URI getBaseUri() {
73 return UriBuilder.fromUri("http://localhost:8181").build();
77 public UriBuilder getBaseUriBuilder() {
78 return UriBuilder.fromUri(getBaseUri());
82 public MultivaluedMap<String, String> getPathParameters() {
83 return new MultivaluedHashMap<>();
87 public MultivaluedMap<String, String> getPathParameters(final boolean decode) {
88 return getPathParameters();
92 public MultivaluedMap<String, String> getQueryParameters() {
97 public MultivaluedMap<String, String> getQueryParameters(final boolean decode) {
98 return getQueryParameters();
102 public List<String> getMatchedURIs() {
107 public List<String> getMatchedURIs(final boolean decode) {
108 return getMatchedURIs();
112 public List<Object> getMatchedResources() {
117 public URI resolve(final URI uri) {
122 public URI relativize(final URI uri) {