How can I get my last path variable to be the remaining path? I have something like this, but it's not getting hit:
@RequestMapping(value = "{storageId}/{repositoryId}/{path}/**",
method = RequestMethod.PUT)
@RequestMapping(value = "{storageId}/{repositoryId}/{path}/**", method = RequestMethod.PUT)
public ResponseEntity upload(@PathVariable(name = "storageId") String storageId,
@PathVariable(name = "repositoryId") String repositoryId,
@PathVariable(name = "path") String path,
MultipartFile multipartFile)
throws ...
{
...
}
In Jersey, I could do it easily like this:
@Path("{storageId}/{repositoryId}/{path:.*}")
... but I have to migrate some code over to Spring MVC.
The problem is that if my URL is:
http://localhost:48080/storages/storage0/snapshots/org/foo/bar/metadata/metadata-foo/3.1-SNAPSHOT/metadata-foo-3.1-20161017.182007-1.jar
my path
gets truncated to:
metadata/metadata-foo/3.1-SNAPSHOT/metadata-foo-3.1-20161017.182007-1.jar
Which is obviously incorrect, as it should be:
org/foo/bar/metadata/metadata-foo/3.1-SNAPSHOT/metadata-foo-3.1-20161017.182007-1.jar
Any advice would be welcome!