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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendPath(Path path) @Nullable StringgetRepositoryLookupPath(String lookupPath) Extracts the actual lookup path within the Spring Data REST managed URI space.@Nullable StringgetRepositoryLookupPath(NativeWebRequest request) Extracts the actual lookup path within the Spring Data REST managed URI space.getUri()Returns the base URI.Returns a newUriComponentsBuilderfor the base URI.
-
Field Details
-
NONE
-
-
Constructor Details
-
BaseUri
-
BaseUri
-
-
Method Details
-
getUri
-
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 newUriComponentsBuilderfor 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:
-