@Test public void test_buildS3Uri() { String requestPath = "bar.jpg"; String expectedUri = "s3: S3AssetsResolver sut = new S3AssetsResolver(null, "assetsbucket", "foo"); String actual = sut.buildS3Uri(requestPath); assertThat(actual, is(expectedUri)); }
public String buildS3Uri(String requestPath) { UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.newInstance(); uriComponentsBuilder.scheme("s3"); uriComponentsBuilder.host(assetsBucket); if (!prefix.isEmpty()) { uriComponentsBuilder.path(prefix); } String[] paths = requestPath.split("/"); for (String path : paths) { uriComponentsBuilder.pathSegment(path); } return uriComponentsBuilder.toUriString(); }
S3AssetsResolver extends AbstractResourceResolver { public String buildS3Uri(String requestPath) { UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.newInstance(); uriComponentsBuilder.scheme("s3"); uriComponentsBuilder.host(assetsBucket); if (!prefix.isEmpty()) { uriComponentsBuilder.path(prefix); } String[] paths = requestPath.split("/"); for (String path : paths) { uriComponentsBuilder.pathSegment(path); } return uriComponentsBuilder.toUriString(); } }
S3AssetsResolver extends AbstractResourceResolver { public String buildS3Uri(String requestPath) { UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.newInstance(); uriComponentsBuilder.scheme("s3"); uriComponentsBuilder.host(assetsBucket); if (!prefix.isEmpty()) { uriComponentsBuilder.path(prefix); } String[] paths = requestPath.split("/"); for (String path : paths) { uriComponentsBuilder.pathSegment(path); } return uriComponentsBuilder.toUriString(); } S3AssetsResolver(S3ObjectResourceLoader s3ObjectResourceLoader, String assetsBucket, String prefix); }
S3AssetsResolver extends AbstractResourceResolver { public String buildS3Uri(String requestPath) { UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.newInstance(); uriComponentsBuilder.scheme("s3"); uriComponentsBuilder.host(assetsBucket); if (!prefix.isEmpty()) { uriComponentsBuilder.path(prefix); } String[] paths = requestPath.split("/"); for (String path : paths) { uriComponentsBuilder.pathSegment(path); } return uriComponentsBuilder.toUriString(); } S3AssetsResolver(S3ObjectResourceLoader s3ObjectResourceLoader, String assetsBucket, String prefix); String buildS3Uri(String requestPath); Resource resolveResourceInternal(String requestPath); }
S3AssetsResolver extends AbstractResourceResolver { public String buildS3Uri(String requestPath) { UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.newInstance(); uriComponentsBuilder.scheme("s3"); uriComponentsBuilder.host(assetsBucket); if (!prefix.isEmpty()) { uriComponentsBuilder.path(prefix); } String[] paths = requestPath.split("/"); for (String path : paths) { uriComponentsBuilder.pathSegment(path); } return uriComponentsBuilder.toUriString(); } S3AssetsResolver(S3ObjectResourceLoader s3ObjectResourceLoader, String assetsBucket, String prefix); String buildS3Uri(String requestPath); Resource resolveResourceInternal(String requestPath);  }