@Test void getUrl_existingObject_returnsUrlWithS3Prefix() throws Exception { AmazonS3Client amazonS3 = mock(AmazonS3Client.class); when(amazonS3.getRegion()).thenReturn(Region.EU_Ireland); SimpleStorageResource simpleStorageResource = new SimpleStorageResource(amazonS3, "bucket", "object", new SyncTaskExecutor()); assertThat(simpleStorageResource.getURL()) .isEqualTo(new URL("https: }
@Override public URL getURL() throws IOException { Region region = this.amazonS3.getRegion().toAWSRegion(); String encodedObjectName = URLEncoder.encode(this.objectName, StandardCharsets.UTF_8.toString()); return new URL("https", region.getServiceEndpoint(AmazonS3Client.S3_SERVICE_NAME), "/" + this.bucketName + "/" + encodedObjectName); }
SimpleStorageResource extends AbstractResource implements WritableResource { @Override public URL getURL() throws IOException { Region region = this.amazonS3.getRegion().toAWSRegion(); String encodedObjectName = URLEncoder.encode(this.objectName, StandardCharsets.UTF_8.toString()); return new URL("https", region.getServiceEndpoint(AmazonS3Client.S3_SERVICE_NAME), "/" + this.bucketName + "/" + encodedObjectName); } }
SimpleStorageResource extends AbstractResource implements WritableResource { @Override public URL getURL() throws IOException { Region region = this.amazonS3.getRegion().toAWSRegion(); String encodedObjectName = URLEncoder.encode(this.objectName, StandardCharsets.UTF_8.toString()); return new URL("https", region.getServiceEndpoint(AmazonS3Client.S3_SERVICE_NAME), "/" + this.bucketName + "/" + encodedObjectName); } SimpleStorageResource(AmazonS3 amazonS3, String bucketName, String objectName,
			TaskExecutor taskExecutor);  SimpleStorageResource(AmazonS3 amazonS3, String bucketName, String objectName,
			TaskExecutor taskExecutor, String versionId); }
SimpleStorageResource extends AbstractResource implements WritableResource { @Override public URL getURL() throws IOException { Region region = this.amazonS3.getRegion().toAWSRegion(); String encodedObjectName = URLEncoder.encode(this.objectName, StandardCharsets.UTF_8.toString()); return new URL("https", region.getServiceEndpoint(AmazonS3Client.S3_SERVICE_NAME), "/" + this.bucketName + "/" + encodedObjectName); } SimpleStorageResource(AmazonS3 amazonS3, String bucketName, String objectName,
			TaskExecutor taskExecutor);  SimpleStorageResource(AmazonS3 amazonS3, String bucketName, String objectName,
			TaskExecutor taskExecutor, String versionId); @Override String getDescription(); @Override InputStream getInputStream(); @Override boolean exists(); @Override long contentLength(); @Override long lastModified(); @Override String getFilename(); @Override URL getURL(); URI getS3Uri(); @Override File getFile(); @Override boolean isWritable(); @Override OutputStream getOutputStream(); @Override SimpleStorageResource createRelative(String relativePath); AmazonS3 getAmazonS3(); }
SimpleStorageResource extends AbstractResource implements WritableResource { @Override public URL getURL() throws IOException { Region region = this.amazonS3.getRegion().toAWSRegion(); String encodedObjectName = URLEncoder.encode(this.objectName, StandardCharsets.UTF_8.toString()); return new URL("https", region.getServiceEndpoint(AmazonS3Client.S3_SERVICE_NAME), "/" + this.bucketName + "/" + encodedObjectName); } SimpleStorageResource(AmazonS3 amazonS3, String bucketName, String objectName,
			TaskExecutor taskExecutor);  SimpleStorageResource(AmazonS3 amazonS3, String bucketName, String objectName,
			TaskExecutor taskExecutor, String versionId); @Override String getDescription(); @Override InputStream getInputStream(); @Override boolean exists(); @Override long contentLength(); @Override long lastModified(); @Override String getFilename(); @Override URL getURL(); URI getS3Uri(); @Override File getFile(); @Override boolean isWritable(); @Override OutputStream getOutputStream(); @Override SimpleStorageResource createRelative(String relativePath); AmazonS3 getAmazonS3();  }