Class BaseUri
java.lang.Object
org.springframework.data.rest.webmvc.BaseUri
Value object to be able to extract the lookup path within a configured base URI that forms a URI namespace.
- Author:
- Oliver Gierke
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionappendPath
(Path path) getRepositoryLookupPath
(String lookupPath) Extracts the actual lookup path within the Spring Data REST managed URI space.getRepositoryLookupPath
(NativeWebRequest request) Extracts the actual lookup path within the Spring Data REST managed URI space.getUri()
Returns the base URI.Returns a newUriComponentsBuilder
for the base URI.
-
Field Details
-
NONE
-
-
Constructor Details
-
Method Details
-
getUri
Returns the base URI.- Returns:
-
getRepositoryLookupPath
Extracts the actual lookup path within the Spring Data REST managed URI space. This includes stripping the necessary parts of the base URI from the source lookup path.- Parameters:
request
- must not be null.- Returns:
- the stripped lookup path with then the repository URI space or null in case the lookup path is not pointing into the repository URI space.
-
getRepositoryLookupPath
Extracts the actual lookup path within the Spring Data REST managed URI space. This includes stripping the necessary parts of the base URI from the source lookup path.- Parameters:
lookupPath
- must not be null.- Returns:
- the stripped lookup path with then the repository URI space or null in case the lookup path is not pointing into the repository URI space.
-
getUriComponentsBuilder
Returns a newUriComponentsBuilder
for the base URI. If the base URI is not absolute, it'll lokup the URI for the current servlet mapping and extend it accordingly.- Returns:
-
appendPath
- Parameters:
path
- must not be null.- Returns:
-