@Test public void test_getFilename_root() throws Exception { String bucketName = "bucket"; String key = "foobar.txt"; String expected = "foobar.txt"; sut = new S3ObjectResource(amazonS3, bucketName, key); String actual = sut.getFilename(); assertThat(actual, is(expected)); }
@Override public String getFilename() throws IllegalStateException { int lastIndexOfPathSeparator = key.lastIndexOf('/'); if (lastIndexOfPathSeparator == -1) { return key; } else { return key.substring(lastIndexOfPathSeparator + 1); } }
S3ObjectResource extends AbstractResource implements WritableResource { @Override public String getFilename() throws IllegalStateException { int lastIndexOfPathSeparator = key.lastIndexOf('/'); if (lastIndexOfPathSeparator == -1) { return key; } else { return key.substring(lastIndexOfPathSeparator + 1); } } }
S3ObjectResource extends AbstractResource implements WritableResource { @Override public String getFilename() throws IllegalStateException { int lastIndexOfPathSeparator = key.lastIndexOf('/'); if (lastIndexOfPathSeparator == -1) { return key; } else { return key.substring(lastIndexOfPathSeparator + 1); } } S3ObjectResource(AmazonS3 amazonS3, String bucketName, String key, TaskExecutor taskExecutor);  S3ObjectResource(AmazonS3 amazonS3, String bucketName, String key, String versionId,
			TaskExecutor taskExecutor);  S3ObjectResource(AmazonS3 amazonS3, String bucketName, String key, Optional<String> versionId);  S3ObjectResource(AmazonS3 amazonS3, String bucketName, String key, String versionId);  S3ObjectResource(AmazonS3 amazonS3, String bucketName, String key); }
S3ObjectResource extends AbstractResource implements WritableResource { @Override public String getFilename() throws IllegalStateException { int lastIndexOfPathSeparator = key.lastIndexOf('/'); if (lastIndexOfPathSeparator == -1) { return key; } else { return key.substring(lastIndexOfPathSeparator + 1); } } S3ObjectResource(AmazonS3 amazonS3, String bucketName, String key, TaskExecutor taskExecutor);  S3ObjectResource(AmazonS3 amazonS3, String bucketName, String key, String versionId,
			TaskExecutor taskExecutor);  S3ObjectResource(AmazonS3 amazonS3, String bucketName, String key, Optional<String> versionId);  S3ObjectResource(AmazonS3 amazonS3, String bucketName, String key, String versionId);  S3ObjectResource(AmazonS3 amazonS3, String bucketName, String key); @Override boolean exists(); @Override URL getURL(); @Override File getFile(); @Override long contentLength(); @Override long lastModified(); @Override S3ObjectResource createRelative(String relativePath); @Override String getFilename(); @Override String getDescription(); @Override InputStream getInputStream(); @Override boolean isWritable(); @Override OutputStream getOutputStream(); }
S3ObjectResource extends AbstractResource implements WritableResource { @Override public String getFilename() throws IllegalStateException { int lastIndexOfPathSeparator = key.lastIndexOf('/'); if (lastIndexOfPathSeparator == -1) { return key; } else { return key.substring(lastIndexOfPathSeparator + 1); } } S3ObjectResource(AmazonS3 amazonS3, String bucketName, String key, TaskExecutor taskExecutor);  S3ObjectResource(AmazonS3 amazonS3, String bucketName, String key, String versionId,
			TaskExecutor taskExecutor);  S3ObjectResource(AmazonS3 amazonS3, String bucketName, String key, Optional<String> versionId);  S3ObjectResource(AmazonS3 amazonS3, String bucketName, String key, String versionId);  S3ObjectResource(AmazonS3 amazonS3, String bucketName, String key); @Override boolean exists(); @Override URL getURL(); @Override File getFile(); @Override long contentLength(); @Override long lastModified(); @Override S3ObjectResource createRelative(String relativePath); @Override String getFilename(); @Override String getDescription(); @Override InputStream getInputStream(); @Override boolean isWritable(); @Override OutputStream getOutputStream();  }