From fe9afb044701f3b28b339933de2b7022271078ad Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Wed, 8 Nov 2023 06:58:10 +0300 Subject: [PATCH] #406 s3-hosts is clean for qulice --- s3auth-hosts/pom.xml | 11 + .../java/com/s3auth/hosts/BucketMocker.java | 12 +- .../java/com/s3auth/hosts/DefaultDynamo.java | 33 +- .../java/com/s3auth/hosts/DefaultHost.java | 7 +- .../com/s3auth/hosts/DefaultResource.java | 3 + .../com/s3auth/hosts/DirectoryListing.java | 3 + .../main/java/com/s3auth/hosts/Domain.java | 38 +- .../java/com/s3auth/hosts/DomainMocker.java | 17 +- .../main/java/com/s3auth/hosts/Dynamo.java | 2 + .../com/s3auth/hosts/H2DomainStatsData.java | 15 +- .../src/main/java/com/s3auth/hosts/Host.java | 2 + .../java/com/s3auth/hosts/HostMocker.java | 12 +- .../src/main/java/com/s3auth/hosts/Hosts.java | 3 + .../java/com/s3auth/hosts/HostsMocker.java | 2 +- .../main/java/com/s3auth/hosts/Htpasswd.java | 13 + .../java/com/s3auth/hosts/MkAmazonS3.java | 813 +++++------------- .../s3auth/hosts/ObjectVersionListing.java | 3 + .../main/java/com/s3auth/hosts/Resource.java | 4 +- .../java/com/s3auth/hosts/ResourceMocker.java | 7 +- .../src/main/java/com/s3auth/hosts/Stats.java | 2 + .../java/com/s3auth/hosts/SyslogHosts.java | 7 +- .../src/main/java/com/s3auth/hosts/User.java | 5 + .../java/com/s3auth/hosts/UserMocker.java | 17 +- .../com/s3auth/hosts/DefaultBucketTest.java | 2 +- .../com/s3auth/hosts/DefaultDomainTest.java | 2 +- .../com/s3auth/hosts/DefaultDynamoTest.java | 2 +- .../com/s3auth/hosts/DefaultHostITCase.java | 4 +- .../com/s3auth/hosts/DefaultHostTest.java | 24 +- .../java/com/s3auth/hosts/DomainTest.java | 4 +- .../java/com/s3auth/hosts/DomainsTest.java | 2 +- .../com/s3auth/hosts/DynamoHostsTest.java | 53 +- .../s3auth/hosts/H2DomainStatsDataTest.java | 4 +- .../java/com/s3auth/hosts/HtpasswdTest.java | 8 +- .../com/s3auth/hosts/RejectingHostTest.java | 2 +- .../java/com/s3auth/hosts/SmartHostTest.java | 4 +- .../com/s3auth/hosts/SyslogHostsTest.java | 7 +- .../java/com/s3auth/relay/HttpRequest.java | 4 +- .../java/com/s3auth/relay/HttpFacadeTest.java | 8 +- .../com/s3auth/relay/HttpRequestTest.java | 2 +- .../com/s3auth/relay/SecuredHostTest.java | 4 +- 40 files changed, 441 insertions(+), 726 deletions(-) diff --git a/s3auth-hosts/pom.xml b/s3auth-hosts/pom.xml index ef283372..ba7512d5 100644 --- a/s3auth-hosts/pom.xml +++ b/s3auth-hosts/pom.xml @@ -97,6 +97,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE. javax.servlet servlet-api 3.0-alpha-1 + provided javax.ws.rs @@ -169,12 +170,22 @@ OF THE POSSIBILITY OF SUCH DAMAGE. com.h2database h2 2.2.224 + runtime com.jcabi jcabi-dynamo 0.22.3 + + com.google.guava + guava + + + org.hamcrest + hamcrest-core + 1.3 + diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/BucketMocker.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/BucketMocker.java index efee845d..0f2041f2 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/BucketMocker.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/BucketMocker.java @@ -47,16 +47,17 @@ public final class BucketMocker { .builder(); /** - * Public ctor. + * Init. + * @return This object */ - @SuppressWarnings("PMD.ConstructorOnlyInitializesOrCallOtherConstructors") - public BucketMocker() { + public BucketMocker init() { this.withName("maven.s3auth.com"); this.withBucket("s3auth"); this.withRegion("ap-southeast-1"); this.withKey("AAAAAAAAAAAAAAAAAAAA"); this.withSecret("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); this.withClient(new MkAmazonS3()); + return this; } /** @@ -127,6 +128,11 @@ public Bucket mock() { return this.bucket.build(); } + /** + * Mock. + * + * @since 0.0.1 + */ @Builder @SuppressWarnings({ "PMD.TooManyMethods", "PMD.AvoidFieldNameMatchingMethodName" }) diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/DefaultDynamo.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/DefaultDynamo.java index c5a64d6e..ae8f2c20 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/DefaultDynamo.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/DefaultDynamo.java @@ -112,20 +112,11 @@ final class DefaultDynamo implements Dynamo { /** * Public ctor. */ - @SuppressWarnings("PMD.ConstructorOnlyInitializesOrCallOtherConstructors") DefaultDynamo() { - Credentials creds = new Credentials.Simple( - Manifests.read("S3Auth-AwsDynamoKey"), - Manifests.read("S3Auth-AwsDynamoSecret") + this( + new ReRegion(new Region.Simple(DefaultDynamo.creds())), + Manifests.read("S3Auth-AwsDynamoTable") ); - if (Manifests.exists("S3Auth-AwsDynamoEntryPoint")) { - creds = new Credentials.Direct( - Credentials.Simple.class.cast(creds), - Manifests.read("S3Auth-AwsDynamoEntryPoint") - ); - } - this.region = new ReRegion(new Region.Simple(creds)); - this.table = Manifests.read("S3Auth-AwsDynamoTable"); } /** @@ -206,6 +197,24 @@ public boolean remove(@NotNull final Domain domain) { return removed; } + /** + * Create AWS credentials. + * @return Creds + */ + private static Credentials creds() { + Credentials creds = new Credentials.Simple( + Manifests.read("S3Auth-AwsDynamoKey"), + Manifests.read("S3Auth-AwsDynamoSecret") + ); + if (Manifests.exists("S3Auth-AwsDynamoEntryPoint")) { + creds = new Credentials.Direct( + Credentials.Simple.class.cast(creds), + Manifests.read("S3Auth-AwsDynamoEntryPoint") + ); + } + return creds; + } + /** * Turn item into domain. * @param item Item diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/DefaultHost.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/DefaultHost.java index f4ba8b93..6dfe70ae 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/DefaultHost.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/DefaultHost.java @@ -65,6 +65,7 @@ * Default implementation of {@link Host}. * * @since 0.0.1 + * @checkstyle ClassFanOutComplexityCheck (1000 lines) */ @Immutable @EqualsAndHashCode(of = "bucket") @@ -267,6 +268,7 @@ public Stats stats() { * Convert URI to all possible S3 object names (in order of importance). * @param uri The URI * @return Object names + * @checkstyle NonStaticMethodCheck (20 lines) */ private Iterable names(final URI uri) { final String name = StringUtils.strip(uri.getPath(), "/"); @@ -281,6 +283,8 @@ private Iterable names(final URI uri) { /** * Object name with a suffix from a bucket. + * + * @since 0.0.1 */ @Loggable(Loggable.DEBUG) private final class NameWithSuffix implements DefaultHost.ObjectName { @@ -322,6 +326,7 @@ public String get() { text.append(suffix); return text.toString(); } + @Override public String toString() { return String.format("%s+suffix", this.origin); @@ -376,7 +381,7 @@ private final class HostStats implements Stats { * Public ctor. * @param bckt The name of the bucket */ - public HostStats(final String bckt) { + HostStats(final String bckt) { this.bucket = bckt; } diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/DefaultResource.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/DefaultResource.java index 1130d363..fb21605a 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/DefaultResource.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/DefaultResource.java @@ -327,12 +327,15 @@ private long size() { /** * Custom IO exception. + * + * @since 0.0.1 */ private static final class StreamingException extends IOException { /** * Serialization marker. */ private static final long serialVersionUID = 0x7529FA781E111179L; + /** * Public ctor. * @param cause The cause of it diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/DirectoryListing.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/DirectoryListing.java index 6ecd4d08..2ae6c8a6 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/DirectoryListing.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/DirectoryListing.java @@ -57,6 +57,8 @@ /** * XML Directory Listing. + * + * @since 0.0.1 * @checkstyle ClassDataAbstraction (200 lines) */ @Immutable @@ -157,6 +159,7 @@ public String etag() { crc.update(this.content); return Long.toHexString(crc.getValue()); } + @Override public Date lastModified() { return new Date(); diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/Domain.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/Domain.java index e087a73e..52f6d89e 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/Domain.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/Domain.java @@ -89,6 +89,11 @@ public interface Domain { */ String syslog(); + /** + * Valid. + * + * @since 0.0.1 + */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Constraint(validatedBy = Domain.Validator.class) @@ -96,14 +101,19 @@ public interface Domain { @interface Valid { /** * Message of the validation error. + * @return Message */ String message() default "invalid domain"; + /** * Groups. + * @return Groups */ Class[] groups() default { }; + /** * Payload. + * @return Payload */ Class[] payload() default { }; } @@ -112,6 +122,9 @@ public interface Domain { * Validator of Domain. * * @since 0.0.1 + * @checkstyle CyclomaticComplexity (200 lines) + * @checkstyle ExecutableStatementCount (200 lines) + * @checkstyle NPathComplexityCheck (200 lines) */ @SuppressWarnings("PMD.NPathComplexity") class Validator implements ConstraintValidator { @@ -119,56 +132,55 @@ class Validator implements ConstraintValidator { public void initialize(final Domain.Valid annotation) { //nothing to do } - // @checkstyle CyclomaticComplexity (60 lines) - // @checkstyle ExecutableStatementCount (60 lines) + @Override public boolean isValid(final Domain domain, final ConstraintValidatorContext ctx) { - boolean isValid = true; + boolean valid = true; if (domain.name() == null) { ctx.buildConstraintViolationWithTemplate( "Domain name is mandatory and can't be NULL" ).addConstraintViolation(); - isValid = false; + valid = false; } else if (!domain.name().matches("\\s*[a-zA-Z0-9\\-.]+\\s*")) { ctx.buildConstraintViolationWithTemplate( String.format("Invalid domain name '%s'", domain.name()) ).addPropertyNode("name").addConstraintViolation(); - isValid = false; + valid = false; } if (domain.key() == null) { ctx.buildConstraintViolationWithTemplate( "AWS key is mandatory and can't be NULL" ).addConstraintViolation(); - isValid = false; + valid = false; } else if (!domain.key().matches("\\s*[A-Z0-9]{20}\\s*")) { ctx.buildConstraintViolationWithTemplate( String.format("Invalid AWS key '%s'", domain.key()) ).addPropertyNode("key").addConstraintViolation(); - isValid = false; + valid = false; } if (domain.region() == null) { ctx.buildConstraintViolationWithTemplate( "AWS S3 region is mandatory and can't be NULL" ).addConstraintViolation(); - isValid = false; + valid = false; } else if (!domain.region().matches("[a-z0-9\\-]*")) { ctx.buildConstraintViolationWithTemplate( String.format("Invalid AWS S3 region '%s'", domain.region()) ).addPropertyNode("region").addConstraintViolation(); - isValid = false; + valid = false; } if (domain.secret() == null) { ctx.buildConstraintViolationWithTemplate( "AWS secret key is mandatory and can't be NULL" ).addConstraintViolation(); - isValid = false; + valid = false; } else if (!domain.secret() .matches("\\s*[a-zA-Z0-9\\+/]{40}\\s*")) { ctx.buildConstraintViolationWithTemplate( String.format("Invalid AWS secret '%s'", domain.secret()) ).addPropertyNode("secret").addConstraintViolation(); - isValid = false; + valid = false; } if (domain.syslog() != null && !domain.syslog() @@ -177,9 +189,9 @@ public boolean isValid(final Domain domain, ctx.buildConstraintViolationWithTemplate( String.format("Invalid syslog host '%s'", domain.syslog()) ).addPropertyNode("syslog").addConstraintViolation(); - isValid = false; + valid = false; } - return isValid; + return valid; } } diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/DomainMocker.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/DomainMocker.java index d87de1bc..3f747546 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/DomainMocker.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/DomainMocker.java @@ -46,16 +46,17 @@ public final class DomainMocker { .builder(); /** - * Public ctor. + * Init. + * @return This object */ - @SuppressWarnings("PMD.ConstructorOnlyInitializesOrCallOtherConstructors") - public DomainMocker() { + public DomainMocker init() { this.withName("localhost"); this.withRegion("us-east-1"); this.withBucket("bucket"); this.withKey("AAAAAAAAAAAAAAAAAAAA"); this.withSecret("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); this.withSyslog("localhost:514"); + return this; } /** @@ -126,6 +127,11 @@ public Domain mock() { return this.domain.build(); } + /** + * Mock. + * + * @since 0.0.1 + */ @Builder @SuppressWarnings({ "PMD.TooManyMethods", "PMD.AvoidFieldNameMatchingMethodName" }) @@ -134,22 +140,27 @@ private static class MkDomain implements Domain { * The Domain Name. */ private final transient String name; + /** * The Domain key. */ private final transient String key; + /** * The Domain secret. */ private final transient String secret; + /** * The Domain bucket. */ private final transient String bucket; + /** * The Domain region. */ private final transient String region; + /** * The Domain syslog. */ diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/Dynamo.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/Dynamo.java index 11d10c0f..75cbe840 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/Dynamo.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/Dynamo.java @@ -71,6 +71,8 @@ interface Dynamo extends Closeable { /** * Client to Amazon. + * + * @since 0.0.1 */ @Immutable interface Client { diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/H2DomainStatsData.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/H2DomainStatsData.java index 80eefb98..0b56177d 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/H2DomainStatsData.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/H2DomainStatsData.java @@ -96,24 +96,31 @@ final class H2DomainStatsData implements DomainStatsData { /** * Public ctor. - * @throws IOException If an IO Exception occurs. */ - H2DomainStatsData() throws IOException { + H2DomainStatsData() { this(new File("s3auth-domainStats")); } /** * Public ctor. * @param file The file pointing to the database to use. - * @throws IOException If an IO Exception occurs. */ - H2DomainStatsData(final File file) throws IOException { + H2DomainStatsData(final File file) { this.jdbc = String.format("jdbc:h2:file:%s", file.getAbsolutePath()); + } + + /** + * Create tables. + * @return This + * @throws IOException If an IO Exception occurs. + */ + public H2DomainStatsData init() throws IOException { try { this.session().sql(H2DomainStatsData.CREATE).execute().commit(); } catch (final SQLException ex) { throw new IOException(ex); } + return this; } @Override diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/Host.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/Host.java index dcbb0a1b..aff64f3d 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/Host.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/Host.java @@ -84,6 +84,8 @@ public interface Host extends Closeable { /** * Client to Amazon CloudWatch. + * + * @since 0.0.1 */ @Immutable interface CloudWatch { diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/HostMocker.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/HostMocker.java index 91597fac..9f32540d 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/HostMocker.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/HostMocker.java @@ -45,13 +45,15 @@ public final class HostMocker { private final transient MkHost.MkHostBuilder host = MkHost.builder(); /** - * Public ctor. + * Initialize it. + * @return This object */ - public HostMocker() { + public HostMocker init() { this.host - .resource(new ResourceMocker().withContent("hello").mock()) + .resource(new ResourceMocker().init().withContent("hello").mock()) .authorized(true) .hidden(true); + return this; } /** @@ -61,7 +63,7 @@ public HostMocker() { * @return This object */ public HostMocker withContent(final URI uri, final String content) { - this.host.resource(new ResourceMocker().withContent(content).mock()); + this.host.resource(new ResourceMocker().init().withContent(content).mock()); return this; } @@ -111,7 +113,7 @@ private static class MkHost implements Host { * The host syslog. */ private final transient String syslog; - + /** * The host stats. */ diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/Hosts.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/Hosts.java index 2ee61249..86098f26 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/Hosts.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/Hosts.java @@ -62,12 +62,15 @@ public interface Hosts extends Closeable { /** * Thrown by {@link #find(String)} if domain is not found. + * + * @since 0.0.1 */ class NotFoundException extends IOException { /** * Serialization marker. */ private static final long serialVersionUID = 0x7529FA789ED21479L; + /** * Public ctor. * @param cause The cause of it diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/HostsMocker.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/HostsMocker.java index 6e265293..37c36386 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/HostsMocker.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/HostsMocker.java @@ -65,7 +65,7 @@ public void close() { @Override public Host find(final String domain) { - return new HostMocker().mock(); + return new HostMocker().init().mock(); } @Override diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/Htpasswd.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/Htpasswd.java index 406b73ea..dd643664 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/Htpasswd.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/Htpasswd.java @@ -180,6 +180,8 @@ private static boolean matches(final String hash, final String password) { /** * Algorithm. + * + * @since 0.0.1 */ private interface Algorithm { /** @@ -193,6 +195,8 @@ private interface Algorithm { /** * MD5 hash builder. + * + * @since 0.0.1 */ @Loggable(Loggable.DEBUG) private static final class Md5 implements Htpasswd.Algorithm { @@ -201,6 +205,7 @@ private static final class Md5 implements Htpasswd.Algorithm { */ private static final Pattern PATTERN = Pattern.compile("\\$apr1\\$([^\\$]+)\\$([a-zA-Z0-9/\\.]+=*)"); + @Override public boolean matches(final String hash, final String password) { final Matcher matcher = Htpasswd.Md5.PATTERN.matcher(hash); @@ -220,6 +225,8 @@ public boolean matches(final String hash, final String password) { /** * SHA1 hash builder. + * + * @since 0.0.1 */ @Loggable(Loggable.DEBUG) private static final class Sha implements Htpasswd.Algorithm { @@ -228,6 +235,7 @@ private static final class Sha implements Htpasswd.Algorithm { */ private static final Pattern PATTERN = Pattern.compile("\\{SHA\\}([a-zA-Z0-9/\\+]+=*)"); + @Override public boolean matches(final String hash, final String password) { final Matcher matcher = Htpasswd.Sha.PATTERN.matcher(hash); @@ -246,6 +254,8 @@ public boolean matches(final String hash, final String password) { /** * UNIX crypt. + * + * @since 0.0.1 */ @Loggable(Loggable.DEBUG) private static final class UnixCrypt implements Htpasswd.Algorithm { @@ -254,6 +264,7 @@ private static final class UnixCrypt implements Htpasswd.Algorithm { */ private static final Pattern PATTERN = Pattern.compile("(\\$[156]\\$)?[a-zA-Z0-9./]+(\\$.*)*"); + @Override public boolean matches(final String hash, final String password) { return Htpasswd.UnixCrypt.PATTERN.matcher(hash).matches() @@ -263,6 +274,8 @@ public boolean matches(final String hash, final String password) { /** * Plain Text. + * + * @since 0.0.1 */ @Loggable(Loggable.DEBUG) private static final class PlainText implements Htpasswd.Algorithm { diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/MkAmazonS3.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/MkAmazonS3.java index 594a41c5..b4646e54 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/MkAmazonS3.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/MkAmazonS3.java @@ -39,7 +39,6 @@ import com.amazonaws.services.s3.S3ResponseMetadata; import com.amazonaws.services.s3.model.AbortMultipartUploadRequest; import com.amazonaws.services.s3.model.AccessControlList; -import com.amazonaws.services.s3.model.Bucket; import com.amazonaws.services.s3.model.BucketAccelerateConfiguration; import com.amazonaws.services.s3.model.BucketCrossOriginConfiguration; import com.amazonaws.services.s3.model.BucketLifecycleConfiguration; @@ -225,159 +224,103 @@ * AmazonS3 Mock (without Mockito). * * @since 0.0.1 - * @checkstyle ThrowsCount (10000 lines) - * @checkstyle RedundantThrows (10000 lines) - * @checkstyle ParameterName (10000 lines) - * @checkstyle DesignForExtension (10000 lines) - * @checkstyle FinalParameters (10000 lines) - * @checkstyle MethodName (10000 lines) - * @checkstyle ParameterNumber (10000 lines) - * @checkstyle BracketsStructure (10000 lines) - * @checkstyle LineLength (10000 lines) - * @checkstyle ClassFanOutComplexity (10000 lines) - * @checkstyle MethodCountCheck (10000 lines) - * @checkstyle FileLengthCheck (10000 lines) + * @checkstyle ThrowsCount (1000 lines) + * @checkstyle RedundantThrows (1000 lines) + * @checkstyle ParameterName (1000 lines) + * @checkstyle DesignForExtension (1000 lines) + * @checkstyle FinalParameters (1000 lines) + * @checkstyle MethodName (1000 lines) + * @checkstyle ParameterNumber (1000 lines) + * @checkstyle BracketsStructure (1000 lines) + * @checkstyle LineLength (1000 lines) + * @checkstyle ClassFanOutComplexity (1000 lines) + * @checkstyle MethodCountCheck (1000 lines) + * @checkstyle LeftCurlyCheck (1000 lines) */ @SuppressWarnings({"PMD", "deprecation", "serial"}) public class MkAmazonS3 implements AmazonS3, Serializable { @Override - public void abortMultipartUpload(AbortMultipartUploadRequest arg0) - throws AmazonClientException { - } + public void abortMultipartUpload(AbortMultipartUploadRequest arg0) throws AmazonClientException { } @Override public void changeObjectStorageClass(String arg0, String arg1, - StorageClass arg2) throws AmazonClientException { - } + StorageClass arg2) throws AmazonClientException { } @Override - public CompleteMultipartUploadResult completeMultipartUpload( - CompleteMultipartUploadRequest arg0) throws AmazonClientException { - return null; - } + public CompleteMultipartUploadResult completeMultipartUpload(CompleteMultipartUploadRequest arg0) throws AmazonClientException { return null; } @Override - public CopyObjectResult copyObject(CopyObjectRequest arg0) - throws AmazonClientException { - return null; - } + public CopyObjectResult copyObject(CopyObjectRequest arg0) throws AmazonClientException { return null; } @Override public CopyObjectResult copyObject(String arg0, String arg1, String arg2, - String arg3) throws AmazonClientException { - return null; - } + String arg3) throws AmazonClientException { return null; } @Override - public CopyPartResult copyPart(CopyPartRequest arg0) - throws AmazonClientException { - return null; - } + public CopyPartResult copyPart(CopyPartRequest arg0) throws AmazonClientException { return null; } @Override - public Bucket createBucket(CreateBucketRequest arg0) - throws AmazonClientException { - return null; - } + public com.amazonaws.services.s3.model.Bucket createBucket(CreateBucketRequest arg0) throws AmazonClientException { return null; } @Override - public Bucket createBucket(String arg0) throws AmazonClientException { - return null; - } + public com.amazonaws.services.s3.model.Bucket createBucket(String arg0) throws AmazonClientException { return null; } @Override - public Bucket createBucket(String arg0, Region arg1) - throws AmazonClientException { - return null; - } + public com.amazonaws.services.s3.model.Bucket createBucket(String arg0, Region arg1) throws AmazonClientException { return null; } @Override - public Bucket createBucket(String arg0, String arg1) - throws AmazonClientException { - return null; - } + public com.amazonaws.services.s3.model.Bucket createBucket(String arg0, String arg1) throws AmazonClientException { return null; } @Override - public void deleteBucket(DeleteBucketRequest arg0) - throws AmazonClientException { - } + public void deleteBucket(DeleteBucketRequest arg0) throws AmazonClientException { } @Override - public void deleteBucket(String arg0) throws AmazonClientException { - } + public void deleteBucket(String arg0) throws AmazonClientException { } @Override - public void deleteBucketCrossOriginConfiguration(String arg0) { - } + public void deleteBucketCrossOriginConfiguration(String arg0) { } @Override - public void deleteBucketCrossOriginConfiguration( - DeleteBucketCrossOriginConfigurationRequest arg0) { - } + public void deleteBucketCrossOriginConfiguration(DeleteBucketCrossOriginConfigurationRequest arg0) { } @Override - public void deleteBucketLifecycleConfiguration(String arg0) { - } + public void deleteBucketLifecycleConfiguration(String arg0) { } @Override - public void deleteBucketLifecycleConfiguration( - DeleteBucketLifecycleConfigurationRequest arg0) { - } + public void deleteBucketLifecycleConfiguration(DeleteBucketLifecycleConfigurationRequest arg0) { } @Override - public void deleteBucketPolicy(String arg0) throws AmazonClientException { - } + public void deleteBucketPolicy(String arg0) throws AmazonClientException { } @Override - public void deleteBucketPolicy(DeleteBucketPolicyRequest arg0) - throws AmazonClientException { - } + public void deleteBucketPolicy(DeleteBucketPolicyRequest arg0) throws AmazonClientException { } @Override - public void deleteBucketTaggingConfiguration(String arg0) { - } + public void deleteBucketTaggingConfiguration(String arg0) { } @Override - public void deleteBucketTaggingConfiguration( - DeleteBucketTaggingConfigurationRequest arg0) { - } + public void deleteBucketTaggingConfiguration(DeleteBucketTaggingConfigurationRequest arg0) { } @Override - public void deleteBucketWebsiteConfiguration(String arg0) - throws AmazonClientException { - } + public void deleteBucketWebsiteConfiguration(String arg0) throws AmazonClientException { } @Override - public void deleteBucketWebsiteConfiguration( - DeleteBucketWebsiteConfigurationRequest arg0) - throws AmazonClientException { - } + public void deleteBucketWebsiteConfiguration(DeleteBucketWebsiteConfigurationRequest arg0) throws AmazonClientException { } @Override - public void deleteObject(DeleteObjectRequest arg0) - throws AmazonClientException { - } + public void deleteObject(DeleteObjectRequest arg0) throws AmazonClientException { } @Override - public void deleteObject(String arg0, String arg1) - throws AmazonClientException { - } + public void deleteObject(String arg0, String arg1) throws AmazonClientException { } @Override - public DeleteObjectsResult deleteObjects(DeleteObjectsRequest arg0) - throws AmazonClientException { - return null; - } + public DeleteObjectsResult deleteObjects(DeleteObjectsRequest arg0) throws AmazonClientException { return null; } @Override - public void deleteVersion(DeleteVersionRequest arg0) - throws AmazonClientException { - } + public void deleteVersion(DeleteVersionRequest arg0) throws AmazonClientException { } @Override - public void deleteVersion(String arg0, String arg1, String arg2) - throws AmazonClientException { - } + public void deleteVersion(String arg0, String arg1, String arg2) throws AmazonClientException { } @Override public boolean doesBucketExist(String arg0) throws AmazonClientException { @@ -390,409 +333,233 @@ public boolean doesBucketExistV2(String s) throws SdkClientException { } @Override - public HeadBucketResult headBucket(HeadBucketRequest headBucketRequest) throws SdkClientException { - return null; - } + public HeadBucketResult headBucket(HeadBucketRequest headBucketRequest) throws SdkClientException { return null; } @Override - public URL generatePresignedUrl(GeneratePresignedUrlRequest arg0) - throws AmazonClientException { - return null; - } + public URL generatePresignedUrl(GeneratePresignedUrlRequest arg0) throws AmazonClientException { return null; } @Override - public URL generatePresignedUrl(String arg0, String arg1, Date arg2) - throws AmazonClientException { - return null; - } + public URL generatePresignedUrl(String arg0, String arg1, Date arg2) throws AmazonClientException { return null; } @Override public URL generatePresignedUrl(String arg0, String arg1, Date arg2, - HttpMethod arg3) throws AmazonClientException { - return null; - } + HttpMethod arg3) throws AmazonClientException { return null; } @Override - public AccessControlList getBucketAcl(String arg0) - throws AmazonClientException { - return null; - } + public AccessControlList getBucketAcl(String arg0) throws AmazonClientException { return null; } @Override - public AccessControlList getBucketAcl(GetBucketAclRequest arg0) - throws AmazonClientException { - return null; - } + public AccessControlList getBucketAcl(GetBucketAclRequest arg0) throws AmazonClientException { return null; } @Override - public BucketCrossOriginConfiguration getBucketCrossOriginConfiguration( - String arg0) { - return null; - } + public BucketCrossOriginConfiguration getBucketCrossOriginConfiguration(String arg0) { return null; } @Override - public BucketCrossOriginConfiguration getBucketCrossOriginConfiguration(GetBucketCrossOriginConfigurationRequest getBucketCrossOriginConfigurationRequest) { - return null; - } + public BucketCrossOriginConfiguration getBucketCrossOriginConfiguration(GetBucketCrossOriginConfigurationRequest getBucketCrossOriginConfigurationRequest) { return null; } @Override - public BucketLifecycleConfiguration getBucketLifecycleConfiguration( - String arg0) { - return null; - } + public BucketLifecycleConfiguration getBucketLifecycleConfiguration(String arg0) { return null; } @Override - public BucketLifecycleConfiguration getBucketLifecycleConfiguration(GetBucketLifecycleConfigurationRequest getBucketLifecycleConfigurationRequest) { - return null; - } + public BucketLifecycleConfiguration getBucketLifecycleConfiguration(GetBucketLifecycleConfigurationRequest getBucketLifecycleConfigurationRequest) { return null; } @Override - public String getBucketLocation(String arg0) throws AmazonClientException { - return null; - } + public String getBucketLocation(String arg0) throws AmazonClientException { return null; } @Override - public String getBucketLocation(GetBucketLocationRequest arg0) - throws AmazonClientException { - return null; - } + public String getBucketLocation(GetBucketLocationRequest arg0) throws AmazonClientException { return null; } @Override - public BucketLoggingConfiguration getBucketLoggingConfiguration(String arg0) - throws AmazonClientException { - return null; - } + public BucketLoggingConfiguration getBucketLoggingConfiguration(String arg0) throws AmazonClientException { return null; } @Override - public BucketLoggingConfiguration getBucketLoggingConfiguration(GetBucketLoggingConfigurationRequest getBucketLoggingConfigurationRequest) throws SdkClientException { - return null; - } + public BucketLoggingConfiguration getBucketLoggingConfiguration(GetBucketLoggingConfigurationRequest getBucketLoggingConfigurationRequest) throws SdkClientException { return null; } @Override - public BucketNotificationConfiguration getBucketNotificationConfiguration( - String arg0) throws AmazonClientException { - return null; - } + public BucketNotificationConfiguration getBucketNotificationConfiguration(String arg0) throws AmazonClientException { return null; } @Override - public BucketNotificationConfiguration getBucketNotificationConfiguration(GetBucketNotificationConfigurationRequest getBucketNotificationConfigurationRequest) throws SdkClientException { - return null; - } + public BucketNotificationConfiguration getBucketNotificationConfiguration(GetBucketNotificationConfigurationRequest getBucketNotificationConfigurationRequest) throws SdkClientException { return null; } @Override - public BucketPolicy getBucketPolicy(String arg0) - throws AmazonClientException { - return null; - } + public BucketPolicy getBucketPolicy(String arg0) throws AmazonClientException { return null; } @Override - public BucketPolicy getBucketPolicy(GetBucketPolicyRequest arg0) - throws AmazonClientException { - return null; - } + public BucketPolicy getBucketPolicy(GetBucketPolicyRequest arg0) throws AmazonClientException { return null; } @Override - public BucketTaggingConfiguration getBucketTaggingConfiguration(String arg0) { - return null; - } + public BucketTaggingConfiguration getBucketTaggingConfiguration(String arg0) { return null; } @Override - public BucketTaggingConfiguration getBucketTaggingConfiguration(GetBucketTaggingConfigurationRequest getBucketTaggingConfigurationRequest) { - return null; - } + public BucketTaggingConfiguration getBucketTaggingConfiguration(GetBucketTaggingConfigurationRequest getBucketTaggingConfigurationRequest) { return null; } @Override - public BucketVersioningConfiguration getBucketVersioningConfiguration( - String arg0) throws AmazonClientException { - return null; - } + public BucketVersioningConfiguration getBucketVersioningConfiguration(String arg0) throws AmazonClientException { return null; } @Override - public BucketVersioningConfiguration getBucketVersioningConfiguration(GetBucketVersioningConfigurationRequest getBucketVersioningConfigurationRequest) throws SdkClientException { - return null; - } + public BucketVersioningConfiguration getBucketVersioningConfiguration(GetBucketVersioningConfigurationRequest getBucketVersioningConfigurationRequest) throws SdkClientException { return null; } @Override - public BucketWebsiteConfiguration getBucketWebsiteConfiguration(String arg0) - throws AmazonClientException { - return null; - } + public BucketWebsiteConfiguration getBucketWebsiteConfiguration(String arg0) throws AmazonClientException { return null; } @Override - public BucketWebsiteConfiguration getBucketWebsiteConfiguration( - GetBucketWebsiteConfigurationRequest arg0) - throws AmazonClientException { - return null; - } + public BucketWebsiteConfiguration getBucketWebsiteConfiguration(GetBucketWebsiteConfigurationRequest arg0) throws AmazonClientException { return null; } @Override - public S3ResponseMetadata getCachedResponseMetadata( - AmazonWebServiceRequest arg0) { - return null; - } + public S3ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest arg0) { return null; } @Override - public S3Object getObject(GetObjectRequest arg0) - throws AmazonClientException { + public S3Object getObject(GetObjectRequest arg0) throws AmazonClientException { return new MkS3Object(); } @Override - public S3Object getObject(String arg0, String arg1) - throws AmazonClientException { - return null; - } + public S3Object getObject(String arg0, String arg1) throws AmazonClientException { return null; } @Override - public ObjectMetadata getObject(GetObjectRequest arg0, File arg1) - throws AmazonClientException { - return null; - } + public ObjectMetadata getObject(GetObjectRequest arg0, File arg1) throws AmazonClientException { return null; } @Override - public String getObjectAsString(String s, String s1) throws SdkClientException { - return null; - } + public String getObjectAsString(String s, String s1) throws SdkClientException { return null; } @Override - public GetObjectTaggingResult getObjectTagging(GetObjectTaggingRequest getObjectTaggingRequest) { - return null; - } + public GetObjectTaggingResult getObjectTagging(GetObjectTaggingRequest getObjectTaggingRequest) { return null; } @Override - public SetObjectTaggingResult setObjectTagging(SetObjectTaggingRequest setObjectTaggingRequest) { - return null; - } + public SetObjectTaggingResult setObjectTagging(SetObjectTaggingRequest setObjectTaggingRequest) { return null; } @Override - public DeleteObjectTaggingResult deleteObjectTagging(DeleteObjectTaggingRequest deleteObjectTaggingRequest) { - return null; - } + public DeleteObjectTaggingResult deleteObjectTagging(DeleteObjectTaggingRequest deleteObjectTaggingRequest) { return null; } @Override - public AccessControlList getObjectAcl(String arg0, String arg1) - throws AmazonClientException { - return null; - } + public AccessControlList getObjectAcl(String arg0, String arg1) throws AmazonClientException { return null; } @Override - public AccessControlList getObjectAcl(String arg0, String arg1, String arg2) - throws AmazonClientException { - return null; - } + public AccessControlList getObjectAcl(String arg0, String arg1, String arg2) throws AmazonClientException { return null; } @Override - public AccessControlList getObjectAcl(GetObjectAclRequest getObjectAclRequest) throws SdkClientException { - return null; - } + public AccessControlList getObjectAcl(GetObjectAclRequest getObjectAclRequest) throws SdkClientException { return null; } @Override - public ObjectMetadata getObjectMetadata(GetObjectMetadataRequest arg0) - throws AmazonClientException { - return null; - } + public ObjectMetadata getObjectMetadata(GetObjectMetadataRequest arg0) throws AmazonClientException { return null; } @Override - public ObjectMetadata getObjectMetadata(String arg0, String arg1) - throws AmazonClientException { - return null; - } + public ObjectMetadata getObjectMetadata(String arg0, String arg1) throws AmazonClientException { return null; } @Override - public Owner getS3AccountOwner() throws AmazonClientException { - return null; - } + public Owner getS3AccountOwner() throws AmazonClientException { return null; } @Override - public Owner getS3AccountOwner(GetS3AccountOwnerRequest getS3AccountOwnerRequest) throws SdkClientException { - return null; - } + public Owner getS3AccountOwner(GetS3AccountOwnerRequest getS3AccountOwnerRequest) throws SdkClientException { return null; } @Override - public InitiateMultipartUploadResult initiateMultipartUpload( - InitiateMultipartUploadRequest arg0) throws AmazonClientException { - return null; - } + public InitiateMultipartUploadResult initiateMultipartUpload(InitiateMultipartUploadRequest arg0) throws AmazonClientException { return null; } @Override - public List listBuckets() throws AmazonClientException { - return null; - } + public List listBuckets() throws AmazonClientException { return null; } @Override - public List listBuckets(ListBucketsRequest arg0) - throws AmazonClientException { - return null; - } + public List listBuckets(ListBucketsRequest arg0) throws AmazonClientException { return null; } @Override - public MultipartUploadListing listMultipartUploads( - ListMultipartUploadsRequest arg0) throws AmazonClientException { - return null; - } + public MultipartUploadListing listMultipartUploads(ListMultipartUploadsRequest arg0) throws AmazonClientException { return null; } @Override - public ObjectListing listNextBatchOfObjects(ObjectListing arg0) - throws AmazonClientException { - return null; - } + public ObjectListing listNextBatchOfObjects(ObjectListing arg0) throws AmazonClientException { return null; } @Override - public ObjectListing listNextBatchOfObjects(ListNextBatchOfObjectsRequest listNextBatchOfObjectsRequest) throws SdkClientException { - return null; - } + public ObjectListing listNextBatchOfObjects(ListNextBatchOfObjectsRequest listNextBatchOfObjectsRequest) throws SdkClientException { return null; } @Override - public VersionListing listNextBatchOfVersions(VersionListing arg0) - throws AmazonClientException { - return null; - } + public VersionListing listNextBatchOfVersions(VersionListing arg0) throws AmazonClientException { return null; } @Override - public VersionListing listNextBatchOfVersions(ListNextBatchOfVersionsRequest listNextBatchOfVersionsRequest) throws SdkClientException { - return null; - } + public VersionListing listNextBatchOfVersions(ListNextBatchOfVersionsRequest listNextBatchOfVersionsRequest) throws SdkClientException { return null; } @Override - public ObjectListing listObjects(String arg0) throws AmazonClientException { - return null; - } + public ObjectListing listObjects(String arg0) throws AmazonClientException { return null; } @Override - public ObjectListing listObjects(ListObjectsRequest arg0) - throws AmazonClientException { - return null; - } + public ObjectListing listObjects(ListObjectsRequest arg0) throws AmazonClientException { return null; } @Override - public ListObjectsV2Result listObjectsV2(String s) throws SdkClientException { - return null; - } + public ListObjectsV2Result listObjectsV2(String s) throws SdkClientException { return null; } @Override - public ListObjectsV2Result listObjectsV2(String s, String s1) throws SdkClientException { - return null; - } + public ListObjectsV2Result listObjectsV2(String s, String s1) throws SdkClientException { return null; } @Override - public ListObjectsV2Result listObjectsV2(ListObjectsV2Request listObjectsV2Request) throws SdkClientException { - return null; - } + public ListObjectsV2Result listObjectsV2(ListObjectsV2Request listObjectsV2Request) throws SdkClientException { return null; } @Override - public ObjectListing listObjects(String arg0, String arg1) - throws AmazonClientException { - return null; - } + public ObjectListing listObjects(String arg0, String arg1) throws AmazonClientException { return null; } @Override - public PartListing listParts(ListPartsRequest arg0) - throws AmazonClientException { - return null; - } + public PartListing listParts(ListPartsRequest arg0) throws AmazonClientException { return null; } @Override - public VersionListing listVersions(ListVersionsRequest arg0) - throws AmazonClientException { - return null; - } + public VersionListing listVersions(ListVersionsRequest arg0) throws AmazonClientException { return null; } @Override - public VersionListing listVersions(String arg0, String arg1) - throws AmazonClientException { - return null; - } + public VersionListing listVersions(String arg0, String arg1) throws AmazonClientException { return null; } @Override public VersionListing listVersions(String arg0, String arg1, String arg2, - String arg3, String arg4, Integer arg5) throws AmazonClientException { - return null; - } + String arg3, String arg4, Integer arg5) throws AmazonClientException { return null; } @Override - public PutObjectResult putObject(PutObjectRequest arg0) - throws AmazonClientException { - return null; - } + public PutObjectResult putObject(PutObjectRequest arg0) throws AmazonClientException { return null; } @Override - public PutObjectResult putObject(String arg0, String arg1, File arg2) - throws AmazonClientException { - return null; - } + public PutObjectResult putObject(String arg0, String arg1, File arg2) throws AmazonClientException { return null; } @Override public PutObjectResult putObject(String arg0, String arg1, - InputStream arg2, ObjectMetadata arg3) throws AmazonClientException { - return null; - } + InputStream arg2, ObjectMetadata arg3) throws AmazonClientException { return null; } @Override - public PutObjectResult putObject(String s, String s1, String s2) throws SdkClientException { - return null; - } + public PutObjectResult putObject(String s, String s1, String s2) throws SdkClientException { return null; } @Override - public void restoreObject(RestoreObjectRequest arg0) - throws AmazonServiceException { - } + public void restoreObject(RestoreObjectRequest arg0) throws AmazonServiceException { } @Override - public RestoreObjectResult restoreObjectV2(RestoreObjectRequest restoreObjectRequest) throws AmazonServiceException { - return null; - } + public RestoreObjectResult restoreObjectV2(RestoreObjectRequest restoreObjectRequest) throws AmazonServiceException { return null; } @Override - @Deprecated - public void restoreObject(String s, String s1, int i) throws AmazonServiceException { - - } + public void restoreObject(String s, String s1, int i) throws AmazonServiceException { } @Override - public void enableRequesterPays(final String bucket) - throws AmazonClientException { - } + public void enableRequesterPays(final String bucket) throws AmazonClientException { } @Override - public void disableRequesterPays(final String bucket) - throws AmazonClientException { - } + public void disableRequesterPays(final String bucket) throws AmazonClientException { } @Override - public boolean isRequesterPaysEnabled(final String bucket) - throws AmazonClientException { + public boolean isRequesterPaysEnabled(final String bucket) throws AmazonClientException { return false; } @Override - public void setRequestPaymentConfiguration(SetRequestPaymentConfigurationRequest setRequestPaymentConfigurationRequest) { - } + public void setRequestPaymentConfiguration(SetRequestPaymentConfigurationRequest setRequestPaymentConfigurationRequest) { } @Override - public void setBucketReplicationConfiguration(String s, BucketReplicationConfiguration bucketReplicationConfiguration) throws SdkClientException { - } + public void setBucketReplicationConfiguration(String s, BucketReplicationConfiguration bucketReplicationConfiguration) throws SdkClientException { } @Override - public void setBucketReplicationConfiguration(SetBucketReplicationConfigurationRequest setBucketReplicationConfigurationRequest) throws SdkClientException { - } + public void setBucketReplicationConfiguration(SetBucketReplicationConfigurationRequest setBucketReplicationConfigurationRequest) throws SdkClientException { } @Override - public BucketReplicationConfiguration getBucketReplicationConfiguration(String s) throws SdkClientException { - return null; - } + public BucketReplicationConfiguration getBucketReplicationConfiguration(String s) throws SdkClientException { return null; } @Override - public BucketReplicationConfiguration getBucketReplicationConfiguration(GetBucketReplicationConfigurationRequest getBucketReplicationConfigurationRequest) throws SdkClientException { - return null; - } + public BucketReplicationConfiguration getBucketReplicationConfiguration(GetBucketReplicationConfigurationRequest getBucketReplicationConfigurationRequest) throws SdkClientException { return null; } @Override - public void deleteBucketReplicationConfiguration(String s) throws SdkClientException { - } + public void deleteBucketReplicationConfiguration(String s) throws SdkClientException { } @Override - public void deleteBucketReplicationConfiguration(DeleteBucketReplicationConfigurationRequest deleteBucketReplicationConfigurationRequest) throws SdkClientException { - } + public void deleteBucketReplicationConfiguration(DeleteBucketReplicationConfigurationRequest deleteBucketReplicationConfigurationRequest) throws SdkClientException { } @Override public boolean doesObjectExist(String s, String s1) throws SdkClientException { @@ -800,443 +567,273 @@ public boolean doesObjectExist(String s, String s1) throws SdkClientException { } @Override - public BucketAccelerateConfiguration getBucketAccelerateConfiguration(String s) throws SdkClientException { - return null; - } + public BucketAccelerateConfiguration getBucketAccelerateConfiguration(String s) throws SdkClientException { return null; } @Override - public BucketAccelerateConfiguration getBucketAccelerateConfiguration(GetBucketAccelerateConfigurationRequest getBucketAccelerateConfigurationRequest) throws SdkClientException { - return null; - } + public BucketAccelerateConfiguration getBucketAccelerateConfiguration(GetBucketAccelerateConfigurationRequest getBucketAccelerateConfigurationRequest) throws SdkClientException { return null; } @Override - public void setBucketAccelerateConfiguration(String s, BucketAccelerateConfiguration bucketAccelerateConfiguration) throws SdkClientException { - } + public void setBucketAccelerateConfiguration(String s, BucketAccelerateConfiguration bucketAccelerateConfiguration) throws SdkClientException { } @Override - public void setBucketAccelerateConfiguration(SetBucketAccelerateConfigurationRequest setBucketAccelerateConfigurationRequest) throws SdkClientException { - } + public void setBucketAccelerateConfiguration(SetBucketAccelerateConfigurationRequest setBucketAccelerateConfigurationRequest) throws SdkClientException { } @Override - public DeleteBucketMetricsConfigurationResult deleteBucketMetricsConfiguration(String s, String s1) throws SdkClientException { - return null; - } + public DeleteBucketMetricsConfigurationResult deleteBucketMetricsConfiguration(String s, String s1) throws SdkClientException { return null; } @Override - public DeleteBucketMetricsConfigurationResult deleteBucketMetricsConfiguration(DeleteBucketMetricsConfigurationRequest deleteBucketMetricsConfigurationRequest) throws SdkClientException { - return null; - } + public DeleteBucketMetricsConfigurationResult deleteBucketMetricsConfiguration(DeleteBucketMetricsConfigurationRequest deleteBucketMetricsConfigurationRequest) throws SdkClientException { return null; } @Override - public GetBucketMetricsConfigurationResult getBucketMetricsConfiguration(String s, String s1) throws SdkClientException { - return null; - } + public GetBucketMetricsConfigurationResult getBucketMetricsConfiguration(String s, String s1) throws SdkClientException { return null; } @Override - public GetBucketMetricsConfigurationResult getBucketMetricsConfiguration(GetBucketMetricsConfigurationRequest getBucketMetricsConfigurationRequest) throws SdkClientException { - return null; - } + public GetBucketMetricsConfigurationResult getBucketMetricsConfiguration(GetBucketMetricsConfigurationRequest getBucketMetricsConfigurationRequest) throws SdkClientException { return null; } @Override - public SetBucketMetricsConfigurationResult setBucketMetricsConfiguration(String s, MetricsConfiguration metricsConfiguration) throws SdkClientException { - return null; - } + public SetBucketMetricsConfigurationResult setBucketMetricsConfiguration(String s, MetricsConfiguration metricsConfiguration) throws SdkClientException { return null; } @Override - public SetBucketMetricsConfigurationResult setBucketMetricsConfiguration(SetBucketMetricsConfigurationRequest setBucketMetricsConfigurationRequest) throws SdkClientException { - return null; - } + public SetBucketMetricsConfigurationResult setBucketMetricsConfiguration(SetBucketMetricsConfigurationRequest setBucketMetricsConfigurationRequest) throws SdkClientException { return null; } @Override - public ListBucketMetricsConfigurationsResult listBucketMetricsConfigurations(ListBucketMetricsConfigurationsRequest listBucketMetricsConfigurationsRequest) throws SdkClientException { - return null; - } + public ListBucketMetricsConfigurationsResult listBucketMetricsConfigurations(ListBucketMetricsConfigurationsRequest listBucketMetricsConfigurationsRequest) throws SdkClientException { return null; } @Override - public DeleteBucketOwnershipControlsResult deleteBucketOwnershipControls(DeleteBucketOwnershipControlsRequest deleteBucketOwnershipControlsRequest) throws SdkClientException { - return null; - } + public DeleteBucketOwnershipControlsResult deleteBucketOwnershipControls(DeleteBucketOwnershipControlsRequest deleteBucketOwnershipControlsRequest) throws SdkClientException { return null; } @Override - public GetBucketOwnershipControlsResult getBucketOwnershipControls(GetBucketOwnershipControlsRequest getBucketOwnershipControlsRequest) throws SdkClientException { - return null; - } + public GetBucketOwnershipControlsResult getBucketOwnershipControls(GetBucketOwnershipControlsRequest getBucketOwnershipControlsRequest) throws SdkClientException { return null; } @Override - public SetBucketOwnershipControlsResult setBucketOwnershipControls(String s, OwnershipControls ownershipControls) throws SdkClientException { - return null; - } + public SetBucketOwnershipControlsResult setBucketOwnershipControls(String s, OwnershipControls ownershipControls) throws SdkClientException { return null; } @Override - public SetBucketOwnershipControlsResult setBucketOwnershipControls(SetBucketOwnershipControlsRequest setBucketOwnershipControlsRequest) throws SdkClientException { - return null; - } + public SetBucketOwnershipControlsResult setBucketOwnershipControls(SetBucketOwnershipControlsRequest setBucketOwnershipControlsRequest) throws SdkClientException { return null; } @Override - public DeleteBucketAnalyticsConfigurationResult deleteBucketAnalyticsConfiguration(String s, String s1) throws SdkClientException { - return null; - } + public DeleteBucketAnalyticsConfigurationResult deleteBucketAnalyticsConfiguration(String s, String s1) throws SdkClientException { return null; } @Override - public DeleteBucketAnalyticsConfigurationResult deleteBucketAnalyticsConfiguration(DeleteBucketAnalyticsConfigurationRequest deleteBucketAnalyticsConfigurationRequest) throws SdkClientException { - return null; - } + public DeleteBucketAnalyticsConfigurationResult deleteBucketAnalyticsConfiguration(DeleteBucketAnalyticsConfigurationRequest deleteBucketAnalyticsConfigurationRequest) throws SdkClientException { return null; } @Override - public GetBucketAnalyticsConfigurationResult getBucketAnalyticsConfiguration(String s, String s1) throws SdkClientException { - return null; - } + public GetBucketAnalyticsConfigurationResult getBucketAnalyticsConfiguration(String s, String s1) throws SdkClientException { return null; } @Override - public GetBucketAnalyticsConfigurationResult getBucketAnalyticsConfiguration(GetBucketAnalyticsConfigurationRequest getBucketAnalyticsConfigurationRequest) throws SdkClientException { - return null; - } + public GetBucketAnalyticsConfigurationResult getBucketAnalyticsConfiguration(GetBucketAnalyticsConfigurationRequest getBucketAnalyticsConfigurationRequest) throws SdkClientException { return null; } @Override - public SetBucketAnalyticsConfigurationResult setBucketAnalyticsConfiguration(String s, AnalyticsConfiguration analyticsConfiguration) throws SdkClientException { - return null; - } + public SetBucketAnalyticsConfigurationResult setBucketAnalyticsConfiguration(String s, AnalyticsConfiguration analyticsConfiguration) throws SdkClientException { return null; } @Override - public SetBucketAnalyticsConfigurationResult setBucketAnalyticsConfiguration(SetBucketAnalyticsConfigurationRequest setBucketAnalyticsConfigurationRequest) throws SdkClientException { - return null; - } + public SetBucketAnalyticsConfigurationResult setBucketAnalyticsConfiguration(SetBucketAnalyticsConfigurationRequest setBucketAnalyticsConfigurationRequest) throws SdkClientException { return null; } @Override - public ListBucketAnalyticsConfigurationsResult listBucketAnalyticsConfigurations(ListBucketAnalyticsConfigurationsRequest listBucketAnalyticsConfigurationsRequest) throws SdkClientException { - return null; - } + public ListBucketAnalyticsConfigurationsResult listBucketAnalyticsConfigurations(ListBucketAnalyticsConfigurationsRequest listBucketAnalyticsConfigurationsRequest) throws SdkClientException { return null; } @Override - public DeleteBucketIntelligentTieringConfigurationResult deleteBucketIntelligentTieringConfiguration(String s, String s1) throws SdkClientException { - return null; - } + public DeleteBucketIntelligentTieringConfigurationResult deleteBucketIntelligentTieringConfiguration(String s, String s1) throws SdkClientException { return null; } @Override - public DeleteBucketIntelligentTieringConfigurationResult deleteBucketIntelligentTieringConfiguration(DeleteBucketIntelligentTieringConfigurationRequest deleteBucketIntelligentTieringConfigurationRequest) throws SdkClientException { - return null; - } + public DeleteBucketIntelligentTieringConfigurationResult deleteBucketIntelligentTieringConfiguration(DeleteBucketIntelligentTieringConfigurationRequest deleteBucketIntelligentTieringConfigurationRequest) throws SdkClientException { return null; } @Override - public GetBucketIntelligentTieringConfigurationResult getBucketIntelligentTieringConfiguration(String s, String s1) throws SdkClientException { - return null; - } + public GetBucketIntelligentTieringConfigurationResult getBucketIntelligentTieringConfiguration(String s, String s1) throws SdkClientException { return null; } @Override - public GetBucketIntelligentTieringConfigurationResult getBucketIntelligentTieringConfiguration(GetBucketIntelligentTieringConfigurationRequest getBucketIntelligentTieringConfigurationRequest) throws SdkClientException { - return null; - } + public GetBucketIntelligentTieringConfigurationResult getBucketIntelligentTieringConfiguration(GetBucketIntelligentTieringConfigurationRequest getBucketIntelligentTieringConfigurationRequest) throws SdkClientException { return null; } @Override - public SetBucketIntelligentTieringConfigurationResult setBucketIntelligentTieringConfiguration(String s, IntelligentTieringConfiguration intelligentTieringConfiguration) throws SdkClientException { - return null; - } + public SetBucketIntelligentTieringConfigurationResult setBucketIntelligentTieringConfiguration(String s, IntelligentTieringConfiguration intelligentTieringConfiguration) throws SdkClientException { return null; } @Override - public SetBucketIntelligentTieringConfigurationResult setBucketIntelligentTieringConfiguration(SetBucketIntelligentTieringConfigurationRequest setBucketIntelligentTieringConfigurationRequest) throws SdkClientException { - return null; - } + public SetBucketIntelligentTieringConfigurationResult setBucketIntelligentTieringConfiguration(SetBucketIntelligentTieringConfigurationRequest setBucketIntelligentTieringConfigurationRequest) throws SdkClientException { return null; } @Override - public ListBucketIntelligentTieringConfigurationsResult listBucketIntelligentTieringConfigurations(ListBucketIntelligentTieringConfigurationsRequest listBucketIntelligentTieringConfigurationsRequest) throws SdkClientException { - return null; - } + public ListBucketIntelligentTieringConfigurationsResult listBucketIntelligentTieringConfigurations(ListBucketIntelligentTieringConfigurationsRequest listBucketIntelligentTieringConfigurationsRequest) throws SdkClientException { return null; } @Override - public DeleteBucketInventoryConfigurationResult deleteBucketInventoryConfiguration(String s, String s1) throws SdkClientException { - return null; - } + public DeleteBucketInventoryConfigurationResult deleteBucketInventoryConfiguration(String s, String s1) throws SdkClientException { return null; } @Override - public DeleteBucketInventoryConfigurationResult deleteBucketInventoryConfiguration(DeleteBucketInventoryConfigurationRequest deleteBucketInventoryConfigurationRequest) throws SdkClientException { - return null; - } + public DeleteBucketInventoryConfigurationResult deleteBucketInventoryConfiguration(DeleteBucketInventoryConfigurationRequest deleteBucketInventoryConfigurationRequest) throws SdkClientException { return null; } @Override - public GetBucketInventoryConfigurationResult getBucketInventoryConfiguration(String s, String s1) throws SdkClientException { - return null; - } + public GetBucketInventoryConfigurationResult getBucketInventoryConfiguration(String s, String s1) throws SdkClientException { return null; } @Override - public GetBucketInventoryConfigurationResult getBucketInventoryConfiguration(GetBucketInventoryConfigurationRequest getBucketInventoryConfigurationRequest) throws SdkClientException { - return null; - } + public GetBucketInventoryConfigurationResult getBucketInventoryConfiguration(GetBucketInventoryConfigurationRequest getBucketInventoryConfigurationRequest) throws SdkClientException { return null; } @Override - public SetBucketInventoryConfigurationResult setBucketInventoryConfiguration(String s, InventoryConfiguration inventoryConfiguration) throws SdkClientException { - return null; - } + public SetBucketInventoryConfigurationResult setBucketInventoryConfiguration(String s, InventoryConfiguration inventoryConfiguration) throws SdkClientException { return null; } @Override - public SetBucketInventoryConfigurationResult setBucketInventoryConfiguration(SetBucketInventoryConfigurationRequest setBucketInventoryConfigurationRequest) throws SdkClientException { - return null; - } + public SetBucketInventoryConfigurationResult setBucketInventoryConfiguration(SetBucketInventoryConfigurationRequest setBucketInventoryConfigurationRequest) throws SdkClientException { return null; } @Override - public ListBucketInventoryConfigurationsResult listBucketInventoryConfigurations(ListBucketInventoryConfigurationsRequest listBucketInventoryConfigurationsRequest) throws SdkClientException { - return null; - } + public ListBucketInventoryConfigurationsResult listBucketInventoryConfigurations(ListBucketInventoryConfigurationsRequest listBucketInventoryConfigurationsRequest) throws SdkClientException { return null; } @Override - public DeleteBucketEncryptionResult deleteBucketEncryption(String s) throws SdkClientException { - return null; - } + public DeleteBucketEncryptionResult deleteBucketEncryption(String s) throws SdkClientException { return null; } @Override - public DeleteBucketEncryptionResult deleteBucketEncryption(DeleteBucketEncryptionRequest deleteBucketEncryptionRequest) throws SdkClientException { - return null; - } + public DeleteBucketEncryptionResult deleteBucketEncryption(DeleteBucketEncryptionRequest deleteBucketEncryptionRequest) throws SdkClientException { return null; } @Override - public GetBucketEncryptionResult getBucketEncryption(String s) throws SdkClientException { - return null; - } + public GetBucketEncryptionResult getBucketEncryption(String s) throws SdkClientException { return null; } @Override - public GetBucketEncryptionResult getBucketEncryption(GetBucketEncryptionRequest getBucketEncryptionRequest) throws SdkClientException { - return null; - } + public GetBucketEncryptionResult getBucketEncryption(GetBucketEncryptionRequest getBucketEncryptionRequest) throws SdkClientException { return null; } @Override - public SetBucketEncryptionResult setBucketEncryption(SetBucketEncryptionRequest setBucketEncryptionRequest) throws SdkClientException { - return null; - } + public SetBucketEncryptionResult setBucketEncryption(SetBucketEncryptionRequest setBucketEncryptionRequest) throws SdkClientException { return null; } @Override - public SetPublicAccessBlockResult setPublicAccessBlock(SetPublicAccessBlockRequest setPublicAccessBlockRequest) { - return null; - } + public SetPublicAccessBlockResult setPublicAccessBlock(SetPublicAccessBlockRequest setPublicAccessBlockRequest) { return null; } @Override - public GetPublicAccessBlockResult getPublicAccessBlock(GetPublicAccessBlockRequest getPublicAccessBlockRequest) { - return null; - } + public GetPublicAccessBlockResult getPublicAccessBlock(GetPublicAccessBlockRequest getPublicAccessBlockRequest) { return null; } @Override - public DeletePublicAccessBlockResult deletePublicAccessBlock(DeletePublicAccessBlockRequest deletePublicAccessBlockRequest) { - return null; - } + public DeletePublicAccessBlockResult deletePublicAccessBlock(DeletePublicAccessBlockRequest deletePublicAccessBlockRequest) { return null; } @Override - public GetBucketPolicyStatusResult getBucketPolicyStatus(GetBucketPolicyStatusRequest getBucketPolicyStatusRequest) { - return null; - } + public GetBucketPolicyStatusResult getBucketPolicyStatus(GetBucketPolicyStatusRequest getBucketPolicyStatusRequest) { return null; } @Override - public SelectObjectContentResult selectObjectContent(SelectObjectContentRequest selectObjectContentRequest) throws SdkClientException { - return null; - } + public SelectObjectContentResult selectObjectContent(SelectObjectContentRequest selectObjectContentRequest) throws SdkClientException { return null; } @Override - public SetObjectLegalHoldResult setObjectLegalHold(SetObjectLegalHoldRequest setObjectLegalHoldRequest) { - return null; - } + public SetObjectLegalHoldResult setObjectLegalHold(SetObjectLegalHoldRequest setObjectLegalHoldRequest) { return null; } @Override - public GetObjectLegalHoldResult getObjectLegalHold(GetObjectLegalHoldRequest getObjectLegalHoldRequest) { - return null; - } + public GetObjectLegalHoldResult getObjectLegalHold(GetObjectLegalHoldRequest getObjectLegalHoldRequest) { return null; } @Override - public SetObjectLockConfigurationResult setObjectLockConfiguration(SetObjectLockConfigurationRequest setObjectLockConfigurationRequest) { - return null; - } + public SetObjectLockConfigurationResult setObjectLockConfiguration(SetObjectLockConfigurationRequest setObjectLockConfigurationRequest) { return null; } @Override - public GetObjectLockConfigurationResult getObjectLockConfiguration(GetObjectLockConfigurationRequest getObjectLockConfigurationRequest) { - return null; - } + public GetObjectLockConfigurationResult getObjectLockConfiguration(GetObjectLockConfigurationRequest getObjectLockConfigurationRequest) { return null; } @Override - public SetObjectRetentionResult setObjectRetention(SetObjectRetentionRequest setObjectRetentionRequest) { - return null; - } + public SetObjectRetentionResult setObjectRetention(SetObjectRetentionRequest setObjectRetentionRequest) { return null; } @Override - public GetObjectRetentionResult getObjectRetention(GetObjectRetentionRequest getObjectRetentionRequest) { - return null; - } + public GetObjectRetentionResult getObjectRetention(GetObjectRetentionRequest getObjectRetentionRequest) { return null; } @Override - public WriteGetObjectResponseResult writeGetObjectResponse(WriteGetObjectResponseRequest writeGetObjectResponseRequest) { - return null; - } + public WriteGetObjectResponseResult writeGetObjectResponse(WriteGetObjectResponseRequest writeGetObjectResponseRequest) { return null; } @Override - public PresignedUrlDownloadResult download(PresignedUrlDownloadRequest presignedUrlDownloadRequest) { - return null; - } + public PresignedUrlDownloadResult download(PresignedUrlDownloadRequest presignedUrlDownloadRequest) { return null; } @Override - public void download(PresignedUrlDownloadRequest presignedUrlDownloadRequest, File file) { - } + public void download(PresignedUrlDownloadRequest presignedUrlDownloadRequest, File file) { } @Override - public PresignedUrlUploadResult upload(PresignedUrlUploadRequest presignedUrlUploadRequest) { - return null; - } + public PresignedUrlUploadResult upload(PresignedUrlUploadRequest presignedUrlUploadRequest) { return null; } @Override - public void shutdown() { - } + public void shutdown() { } @Override - public Region getRegion() { - return null; - } + public Region getRegion() { return null; } @Override - public String getRegionName() { - return null; - } + public String getRegionName() { return null; } @Override - public URL getUrl(String s, String s1) { - return null; - } + public URL getUrl(String s, String s1) { return null; } @Override - public AmazonS3Waiters waiters() { - return null; - } + public AmazonS3Waiters waiters() { return null; } @Override - public void setBucketAcl(SetBucketAclRequest arg0) - throws AmazonClientException { - } + public void setBucketAcl(SetBucketAclRequest arg0) throws AmazonClientException { } @Override - public void setBucketAcl(String arg0, AccessControlList arg1) - throws AmazonClientException { - } + public void setBucketAcl(String arg0, AccessControlList arg1) throws AmazonClientException { } @Override - public void setBucketAcl(String arg0, CannedAccessControlList arg1) - throws AmazonClientException { - } + public void setBucketAcl(String arg0, CannedAccessControlList arg1) throws AmazonClientException { } @Override - public void setBucketCrossOriginConfiguration( - SetBucketCrossOriginConfigurationRequest arg0) { - } + public void setBucketCrossOriginConfiguration(SetBucketCrossOriginConfigurationRequest arg0) { } @Override - public void setBucketCrossOriginConfiguration(String arg0, - BucketCrossOriginConfiguration arg1) { - } + public void setBucketCrossOriginConfiguration(String arg0, BucketCrossOriginConfiguration arg1) { } @Override - public void setBucketLifecycleConfiguration( - SetBucketLifecycleConfigurationRequest arg0) { - } + public void setBucketLifecycleConfiguration(SetBucketLifecycleConfigurationRequest arg0) { } @Override - public void setBucketLifecycleConfiguration(String arg0, - BucketLifecycleConfiguration arg1) { - } + public void setBucketLifecycleConfiguration(String arg0, BucketLifecycleConfiguration arg1) { } @Override - public void setBucketLoggingConfiguration( - SetBucketLoggingConfigurationRequest arg0) - throws AmazonClientException { - } + public void setBucketLoggingConfiguration(SetBucketLoggingConfigurationRequest arg0) throws AmazonClientException { } @Override - public void setBucketNotificationConfiguration( - SetBucketNotificationConfigurationRequest arg0) - throws AmazonClientException { - } + public void setBucketNotificationConfiguration(SetBucketNotificationConfigurationRequest arg0) throws AmazonClientException { } @Override - public void setBucketNotificationConfiguration(String arg0, - BucketNotificationConfiguration arg1) throws AmazonClientException { - } + public void setBucketNotificationConfiguration(String arg0, BucketNotificationConfiguration arg1) throws AmazonClientException { } @Override - public void setBucketPolicy(SetBucketPolicyRequest arg0) - throws AmazonClientException { - } + public void setBucketPolicy(SetBucketPolicyRequest arg0) throws AmazonClientException { } @Override - public void setBucketPolicy(String arg0, String arg1) - throws AmazonClientException { - } + public void setBucketPolicy(String arg0, String arg1) throws AmazonClientException { } @Override - public void setBucketTaggingConfiguration( - SetBucketTaggingConfigurationRequest arg0) { - } + public void setBucketTaggingConfiguration(SetBucketTaggingConfigurationRequest arg0) { } @Override - public void setBucketTaggingConfiguration(String arg0, - BucketTaggingConfiguration arg1) { - } + public void setBucketTaggingConfiguration(String arg0, BucketTaggingConfiguration arg1) { } @Override - public void setBucketVersioningConfiguration( - SetBucketVersioningConfigurationRequest arg0) - throws AmazonClientException { - } + public void setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest arg0) throws AmazonClientException { } @Override - public void setBucketWebsiteConfiguration( - SetBucketWebsiteConfigurationRequest arg0) - throws AmazonClientException { - } + public void setBucketWebsiteConfiguration(SetBucketWebsiteConfigurationRequest arg0) throws AmazonClientException { } @Override - public void setBucketWebsiteConfiguration(String arg0, - BucketWebsiteConfiguration arg1) throws AmazonClientException { - } + public void setBucketWebsiteConfiguration(String arg0, BucketWebsiteConfiguration arg1) throws AmazonClientException { } @Override - public void setEndpoint(String arg0) { - } + public void setEndpoint(String arg0) { } @Override - public void setObjectAcl(String arg0, String arg1, AccessControlList arg2) - throws AmazonClientException { - } + public void setObjectAcl(String arg0, String arg1, AccessControlList arg2) throws AmazonClientException { } @Override - public void setObjectAcl(String arg0, String arg1, - CannedAccessControlList arg2) throws AmazonClientException { - } + public void setObjectAcl(String arg0, String arg1, CannedAccessControlList arg2) throws AmazonClientException { } @Override - public void setObjectAcl(String arg0, String arg1, String arg2, - AccessControlList arg3) throws AmazonClientException { - } + public void setObjectAcl(String arg0, String arg1, String arg2, AccessControlList arg3) throws AmazonClientException { } @Override - public void setObjectAcl(String arg0, String arg1, String arg2, - CannedAccessControlList arg3) throws AmazonClientException { - } + public void setObjectAcl(String arg0, String arg1, String arg2, CannedAccessControlList arg3) throws AmazonClientException { } @Override - public void setObjectAcl(SetObjectAclRequest setObjectAclRequest) throws SdkClientException { - } + public void setObjectAcl(SetObjectAclRequest setObjectAclRequest) throws SdkClientException { } @Override - public void setObjectRedirectLocation(String arg0, String arg1, String arg2) - throws AmazonClientException { - } + public void setObjectRedirectLocation(String arg0, String arg1, String arg2) throws AmazonClientException { } @Override - public void setRegion(com.amazonaws.regions.Region arg0) - throws IllegalArgumentException { - } + public void setRegion(com.amazonaws.regions.Region arg0) throws IllegalArgumentException { } @Override - public void setS3ClientOptions(S3ClientOptions arg0) { - } + public void setS3ClientOptions(S3ClientOptions arg0) { } @Override - public UploadPartResult uploadPart(UploadPartRequest arg0) - throws AmazonClientException { - return null; - } + public UploadPartResult uploadPart(UploadPartRequest arg0) throws AmazonClientException { return null; } + /** + * Object. + * @since 0.0.1 + */ public static class MkS3Object extends S3Object { @Override public S3ObjectInputStream getObjectContent() { diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/ObjectVersionListing.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/ObjectVersionListing.java index 85d4d8bc..fb3b09c8 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/ObjectVersionListing.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/ObjectVersionListing.java @@ -57,6 +57,8 @@ /** * XML S3 Object Version Listing. + * + * @since 0.0.1 */ @Immutable @ToString @@ -150,6 +152,7 @@ public String etag() { crc.update(this.content); return Long.toHexString(crc.getValue()); } + @Override public Date lastModified() { return new Date(); diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/Resource.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/Resource.java index ea02519e..19141f36 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/Resource.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/Resource.java @@ -97,6 +97,7 @@ public interface Resource extends Closeable { /** * Simple resource made out of plain text. + * * @since 0.0.1 */ @Immutable @@ -113,7 +114,7 @@ final class PlainText implements Resource { /** * Last modified date to return. Equal to the time of object creation. */ - private final transient long modified = System.currentTimeMillis(); + private final transient long modified; /** * Headers associated with this resource. @@ -125,6 +126,7 @@ final class PlainText implements Resource { * @param txt The text to show */ public PlainText(@NotNull final String txt) { + this.modified = System.currentTimeMillis(); this.text = txt.getBytes(StandardCharsets.UTF_8); this.hdrs = new Array<>( String.format( diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/ResourceMocker.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/ResourceMocker.java index 63486f9c..3e6ef287 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/ResourceMocker.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/ResourceMocker.java @@ -55,12 +55,13 @@ public final class ResourceMocker { .builder(); /** - * Public ctor. + * Default one. + * @return This object */ - @SuppressWarnings("PMD.ConstructorOnlyInitializesOrCallOtherConstructors") - public ResourceMocker() { + public ResourceMocker init() { this.withContent("no content"); this.resource.status(HttpURLConnection.HTTP_OK); + return this; } /** diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/Stats.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/Stats.java index 1f302661..70c65044 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/Stats.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/Stats.java @@ -47,6 +47,8 @@ public interface Stats { /** * Simple stats. + * + * @since 0.0.1 */ @Immutable @EqualsAndHashCode(of = "bytes") diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/SyslogHosts.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/SyslogHosts.java index eb3c5201..b59e4dab 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/SyslogHosts.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/SyslogHosts.java @@ -88,6 +88,8 @@ public Set domains(final User user) throws IOException { /** * Syslog host wrapper. + * + * @since 0.0.1 */ @Immutable @EqualsAndHashCode(of = "host") @@ -163,6 +165,8 @@ public Stats stats() { /** * Syslog Resource wrapper. + * + * @since 0.0.1 */ private static final class SyslogResource implements Resource { /** @@ -188,6 +192,7 @@ private static final class SyslogResource implements Resource { * @param port The syslog port * @checkstyle ParameterNumber (4 lines) */ + @SuppressWarnings("PMD.ConstructorOnlyInitializesOrCallOtherConstructors") SyslogResource(final Resource res, final URI uri, final String syslg, final int port) { this.resource = res; @@ -203,7 +208,7 @@ public int status() { @Override public long writeTo(final OutputStream stream) throws IOException { - long bytes; + final long bytes; try { bytes = this.resource.writeTo(stream); this.syslog.info( diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/User.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/User.java index 85f136f4..14782612 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/User.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/User.java @@ -103,22 +103,27 @@ public URI photo() { @interface Valid { /** * Message of the validation error. + * @return Message */ String message() default "invalid user"; /** * Groups. + * @return Groups */ Class[] groups() default { }; /** * Payload. + * @return Payload */ Class[] payload() default { }; } /** * Validator of User. + * + * @since 0.0.1 */ class Validator implements ConstraintValidator { @Override diff --git a/s3auth-hosts/src/main/java/com/s3auth/hosts/UserMocker.java b/s3auth-hosts/src/main/java/com/s3auth/hosts/UserMocker.java index 13743f4e..76ad1e14 100644 --- a/s3auth-hosts/src/main/java/com/s3auth/hosts/UserMocker.java +++ b/s3auth-hosts/src/main/java/com/s3auth/hosts/UserMocker.java @@ -45,16 +45,17 @@ public final class UserMocker { * The mock. */ private final transient MkUser.MkUserBuilder user = MkUser.builder(); + /** * Random generator. */ private final transient Random rand = new Random(); /** - * Public ctor. + * Default one. + * @return This object */ - @SuppressWarnings("PMD.ConstructorOnlyInitializesOrCallOtherConstructors") - public UserMocker() { + public UserMocker init() { this.withIdentity( new URN( "facebook", @@ -63,6 +64,7 @@ public UserMocker() { ); this.user.name("John Doe"); this.user.photo(URI.create("#")); + return this; } /** @@ -92,6 +94,11 @@ public User mock() { return this.user.build(); } + /** + * Mock. + * + * @since 0.0.1 + */ @Builder @SuppressWarnings({ "PMD.TooManyMethods", "PMD.AvoidFieldNameMatchingMethodName" }) @@ -100,10 +107,12 @@ private static class MkUser implements User { * The User identity. */ private final transient URN identity; + /** - * The User name. + * The user name. */ private final transient String name; + /** * The User photo. */ diff --git a/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultBucketTest.java b/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultBucketTest.java index f5e8fbf5..72c339d9 100644 --- a/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultBucketTest.java +++ b/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultBucketTest.java @@ -45,7 +45,7 @@ final class DefaultBucketTest { */ @Test void reproducesPropertiesOfDomain() { - final Domain domain = new DomainMocker().mock(); + final Domain domain = new DomainMocker().init().mock(); MatcherAssert.assertThat( new DefaultBucket(domain).name(), Matchers.equalTo(domain.name()) diff --git a/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultDomainTest.java b/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultDomainTest.java index 7c51f8a4..e2e4c385 100644 --- a/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultDomainTest.java +++ b/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultDomainTest.java @@ -44,7 +44,7 @@ final class DefaultDomainTest { */ @Test void reproducesProperties() { - final Domain domain = new DomainMocker().mock(); + final Domain domain = new DomainMocker().init().mock(); MatcherAssert.assertThat( new DefaultDomain(domain).name(), Matchers.equalTo(domain.name()) diff --git a/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultDynamoTest.java b/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultDynamoTest.java index 4ab4fa3d..703994c5 100644 --- a/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultDynamoTest.java +++ b/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultDynamoTest.java @@ -63,7 +63,7 @@ void loadsDynamoConfiguration() throws Exception { dynamo.load().size(), Matchers.is(size) ); - dynamo.add(new URN("urn:test:alpha"), new DomainMocker().mock()); + dynamo.add(new URN("urn:test:alpha"), new DomainMocker().init().mock()); MatcherAssert.assertThat( dynamo.load().size(), Matchers.is(size + 1) diff --git a/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultHostITCase.java b/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultHostITCase.java index 8e415d0c..a22ce964 100644 --- a/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultHostITCase.java +++ b/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultHostITCase.java @@ -57,7 +57,7 @@ void fetchesRealObjectFromAmazonBucket() throws Exception { Assume.assumeThat(key, Matchers.notNullValue()); final Host host = new DefaultHost( new DefaultBucket( - new DomainMocker() + new DomainMocker().init() .withName("maven.s3auth.com") .withKey(key) .withSecret(secret) @@ -87,7 +87,7 @@ void fetchesRealObjectFromAmazonBucket() throws Exception { void throwsWhenAbsentResource() { final Host host = new DefaultHost( new DefaultBucket( - new DomainMocker() + new DomainMocker().init() .withName("invalid-bucket.s3auth.com") .withKey("foo") .withSecret("invalid-data") diff --git a/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultHostTest.java b/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultHostTest.java index 35738eec..876b6408 100644 --- a/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultHostTest.java +++ b/s3auth-hosts/src/test/java/com/s3auth/hosts/DefaultHostTest.java @@ -58,8 +58,8 @@ import org.apache.http.HttpStatus; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; -import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.mockito.stubbing.Answer; @@ -97,7 +97,7 @@ void loadsAmazonResourcesFrom() throws Exception { Mockito.doReturn(new BucketWebsiteConfiguration(suffix)) .when(aws).getBucketWebsiteConfiguration(Mockito.anyString()); final Host host = new DefaultHost( - new BucketMocker().withClient(aws).mock(), this.cloudWatch() + new BucketMocker().init().withClient(aws).mock(), this.cloudWatch() ); @SuppressWarnings("PMD.NonStaticInitializer") final ConcurrentMap paths = @@ -129,7 +129,7 @@ void loadsAmazonResourcesFrom() throws Exception { @Test void showsStatsInToString() { MatcherAssert.assertThat( - new DefaultHost(new BucketMocker().mock()), + new DefaultHost(new BucketMocker().init().mock()), Matchers.hasToString(Matchers.notNullValue()) ); } @@ -142,7 +142,7 @@ void showsStatsInToString() { void rejectsAuthorizationWhenInvalidCredentials() throws Exception { MatcherAssert.assertThat( new DefaultHost( - new BucketMocker().mock(), this.cloudWatch() + new BucketMocker().init().mock(), this.cloudWatch() ).authorized("1", "2"), Matchers.is(false) ); @@ -168,7 +168,7 @@ void throwsExceptionForNonexistentBucket() { Assertions.assertThrows( IOException.class, () -> new DefaultHost( - new BucketMocker().withBucket(bucket).withClient(aws).mock(), + new BucketMocker().init().withBucket(bucket).withClient(aws).mock(), this.cloudWatch() ).fetch(URI.create("/.htpasswd"), Range.ENTIRE, Version.LATEST) ).getMessage(), @@ -206,7 +206,7 @@ void showsDirectoryListing() throws Exception { MatcherAssert.assertThat( ResourceMocker.toString( new DefaultHost( - new BucketMocker().withClient(client).mock(), + new BucketMocker().init().withClient(client).mock(), this.cloudWatch() ).fetch(new URI(key), Range.ENTIRE, Version.LATEST) ), @@ -237,7 +237,7 @@ void showsVersionListing() throws Exception { MatcherAssert.assertThat( ResourceMocker.toString( new DefaultHost( - new BucketMocker().withClient(client).mock(), + new BucketMocker().init().withClient(client).mock(), this.cloudWatch() ).fetch(new URI(key), Range.ENTIRE, Version.LIST) ), @@ -266,7 +266,7 @@ void showsVersionListingForIndexHtml() throws Exception { MatcherAssert.assertThat( ResourceMocker.toString( new DefaultHost( - new BucketMocker().withClient(client).mock(), + new BucketMocker().init().withClient(client).mock(), this.cloudWatch() ).fetch(new URI(key), Range.ENTIRE, Version.LIST) ), @@ -289,14 +289,14 @@ void retrievesAndCachesCloudWatchStats() { .getMetricStatistics(Mockito.any(GetMetricStatisticsRequest.class)); MatcherAssert.assertThat( new DefaultHost( - new BucketMocker().mock(), + new BucketMocker().init().mock(), cloudwatch ).stats().bytesTransferred(), Matchers.allOf( Matchers.is(sum), Matchers.is( new DefaultHost( - new BucketMocker().mock(), + new BucketMocker().init().mock(), cloudwatch ).stats().bytesTransferred() ) @@ -339,7 +339,7 @@ void loadsErrorDocument() throws Exception { new BucketWebsiteConfiguration(suffix, error) ).when(aws).getBucketWebsiteConfiguration(Mockito.anyString()); final Host host = new DefaultHost( - new BucketMocker().withClient(aws).mock(), this.cloudWatch() + new BucketMocker().init().withClient(aws).mock(), this.cloudWatch() ); MatcherAssert.assertThat( ResourceMocker.toString( @@ -362,7 +362,7 @@ void throwsExceptionIfNoBucketWebsiteConfiguration() { Assertions.assertThrows( IOException.class, () -> new DefaultHost( - new BucketMocker().withClient(aws).mock(), this.cloudWatch() + new BucketMocker().init().withClient(aws).mock(), this.cloudWatch() ).fetch(URI.create("failed.html"), Range.ENTIRE, Version.LATEST) ); } diff --git a/s3auth-hosts/src/test/java/com/s3auth/hosts/DomainTest.java b/s3auth-hosts/src/test/java/com/s3auth/hosts/DomainTest.java index 26185c0a..1bf605bc 100644 --- a/s3auth-hosts/src/test/java/com/s3auth/hosts/DomainTest.java +++ b/s3auth-hosts/src/test/java/com/s3auth/hosts/DomainTest.java @@ -53,7 +53,7 @@ void acceptsValidSyslog() { .buildConstraintViolationWithTemplate(Mockito.anyString()); Mockito.doReturn(Mockito.mock(NodeBuilderCustomizableContext.class)) .when(builder).addPropertyNode(Mockito.anyString()); - final Domain domain = new DomainMocker() + final Domain domain = new DomainMocker().init() .withSyslog("sys-log.s3auth.com:514").mock(); MatcherAssert.assertThat( new Domain.Validator().isValid(domain, ctx), @@ -71,7 +71,7 @@ void rejectsInvalidSyslog() { .buildConstraintViolationWithTemplate(Mockito.anyString()); Mockito.doReturn(Mockito.mock(NodeBuilderCustomizableContext.class)) .when(builder).addPropertyNode(Mockito.anyString()); - final Domain domain = new DomainMocker() + final Domain domain = new DomainMocker().init() .withSyslog("!?@?#.com:ba14").mock(); MatcherAssert.assertThat( new Domain.Validator().isValid(domain, ctx), diff --git a/s3auth-hosts/src/test/java/com/s3auth/hosts/DomainsTest.java b/s3auth-hosts/src/test/java/com/s3auth/hosts/DomainsTest.java index 4105e178..6baeccc3 100644 --- a/s3auth-hosts/src/test/java/com/s3auth/hosts/DomainsTest.java +++ b/s3auth-hosts/src/test/java/com/s3auth/hosts/DomainsTest.java @@ -44,7 +44,7 @@ final class DomainsTest { */ @Test void addsAndRetrievesDomains() { - final Domain domain = new DomainMocker().mock(); + final Domain domain = new DomainMocker().init().mock(); final Domains domains = new Domains(); domains.add(domain); MatcherAssert.assertThat( diff --git a/s3auth-hosts/src/test/java/com/s3auth/hosts/DynamoHostsTest.java b/s3auth-hosts/src/test/java/com/s3auth/hosts/DynamoHostsTest.java index b8db8bea..57c47327 100644 --- a/s3auth-hosts/src/test/java/com/s3auth/hosts/DynamoHostsTest.java +++ b/s3auth-hosts/src/test/java/com/s3auth/hosts/DynamoHostsTest.java @@ -40,6 +40,7 @@ /** * Test case for {@link DynamoHosts}. + * * @since 0.0.1 */ final class DynamoHostsTest { @@ -51,8 +52,8 @@ final class DynamoHostsTest { @Test void updatesCachedData() throws Exception { final Hosts hosts = new DynamoHosts(new DynamoMocker().mock()); - final Domain domain = new DomainMocker().mock(); - final User user = new UserMocker().mock(); + final Domain domain = new DomainMocker().init().mock(); + final User user = new UserMocker().init().mock(); MatcherAssert.assertThat( hosts.domains(user).add(domain), Matchers.is(true) @@ -72,11 +73,11 @@ void updatesCachedData() throws Exception { @Test void rejectsDuplicatesFromDifferentUsers() throws Exception { final Hosts hosts = new DynamoHosts(new DynamoMocker().mock()); - final Domain domain = new DomainMocker().withName("ibm.com").mock(); - final User first = new UserMocker() + final Domain domain = new DomainMocker().init().withName("ibm.com").mock(); + final User first = new UserMocker().init() .withIdentity("urn:facebook:7743") .mock(); - final User second = new UserMocker() + final User second = new UserMocker().init() .withIdentity("urn:facebook:7746") .mock(); hosts.domains(first).remove(domain); @@ -98,11 +99,11 @@ void rejectsDuplicatesFromDifferentUsers() throws Exception { @Test void protectsDomainsAgainstRemoval() throws Exception { final Hosts hosts = new DynamoHosts(new DynamoMocker().mock()); - final Domain domain = new DomainMocker().withName("yahoo.com").mock(); - final User first = new UserMocker() + final Domain domain = new DomainMocker().init().withName("yahoo.com").mock(); + final User first = new UserMocker().init() .withIdentity("urn:facebook:5543") .mock(); - final User second = new UserMocker() + final User second = new UserMocker().init() .withIdentity("urn:facebook:5546") .mock(); hosts.domains(first).remove(domain); @@ -124,12 +125,12 @@ void protectsDomainsAgainstRemoval() throws Exception { @Test void trimsDomainProperties() throws Exception { final Hosts hosts = new DynamoHosts(new DynamoMocker().mock()); - final Domain domain = new DomainMocker() + final Domain domain = new DomainMocker().init() .withName(" google.com ") .withKey(" AKI56FXVOY5FEEZNZXAQ ") .withSecret(" ZFomiC6OObi6gD2J1QQcaW1evMUfqv5fVkpDImI9 ") .mock(); - final User first = new UserMocker() + final User first = new UserMocker().init() .withIdentity("urn:facebook:8989") .mock(); hosts.domains(first).remove(domain); @@ -157,11 +158,11 @@ public boolean matches(final Object obj) { /** * DynamoHosts can reject invalid user names. */ - @Disabled @Test + @Disabled void rejectsInvalidUserNames() { final Hosts hosts = new DynamoHosts(new DynamoMocker().mock()); - final User user = new UserMocker() + final User user = new UserMocker().init() .withIdentity("urn:unknown:4254353") .mock(); Assertions.assertThrows( @@ -182,16 +183,16 @@ void rejectsInvalidUserNames() { */ @Test @Disabled - public void rejectsBrokenDomains() throws Exception { + void rejectsBrokenDomains() throws Exception { final Hosts hosts = new DynamoHosts(new DynamoMocker().mock()); - final User user = new UserMocker().mock(); + final User user = new UserMocker().init().mock(); final Domain[] domains = new Domain[] { - new DomainMocker().withName("").mock(), - new DomainMocker().withName("invalid domain name").mock(), - new DomainMocker().withKey("").mock(), - new DomainMocker().withSecret("").mock(), - new DomainMocker().withKey("broken-key").mock(), - new DomainMocker().withSecret("broken-secret").mock(), + new DomainMocker().init().withName("").mock(), + new DomainMocker().init().withName("invalid domain name").mock(), + new DomainMocker().init().withKey("").mock(), + new DomainMocker().init().withSecret("").mock(), + new DomainMocker().init().withKey("broken-key").mock(), + new DomainMocker().init().withSecret("broken-secret").mock(), }; for (final Domain domain : domains) { try { @@ -211,20 +212,20 @@ public void rejectsBrokenDomains() throws Exception { @Test void fetchesAllDomainsForSuperUser() throws Exception { final Hosts hosts = new DynamoHosts(new DynamoMocker().mock()); - final Domain first = new DomainMocker().withName("first.com").mock(); - final Domain second = new DomainMocker().withName("second.com").mock(); + final Domain first = new DomainMocker().init().withName("first.com").mock(); + final Domain second = new DomainMocker().init().withName("second.com").mock(); hosts.domains( - new UserMocker().withIdentity("urn:facebook:5547").mock() + new UserMocker().init().withIdentity("urn:facebook:5547").mock() ).add(first); hosts.domains( - new UserMocker().withIdentity("urn:facebook:5548").mock() + new UserMocker().init().withIdentity("urn:facebook:5548").mock() ).add(second); final Set domains = hosts.domains( - new UserMocker().withIdentity("urn:github:526301").mock() + new UserMocker().init().withIdentity("urn:github:526301").mock() ); MatcherAssert.assertThat( domains, - Matchers.iterableWithSize(2) + Matchers.iterableWithSize(2) ); hosts.close(); } diff --git a/s3auth-hosts/src/test/java/com/s3auth/hosts/H2DomainStatsDataTest.java b/s3auth-hosts/src/test/java/com/s3auth/hosts/H2DomainStatsDataTest.java index eaf7c47e..5b49f179 100644 --- a/s3auth-hosts/src/test/java/com/s3auth/hosts/H2DomainStatsDataTest.java +++ b/s3auth-hosts/src/test/java/com/s3auth/hosts/H2DomainStatsDataTest.java @@ -45,7 +45,7 @@ final class H2DomainStatsDataTest { void putsAndGetsDataPerDomain() throws Exception { final H2DomainStatsData data = new H2DomainStatsData( File.createTempFile("test", "temp") - ); + ).init(); final String domain = "test-put-domain"; final long bytes = 100; data.put( @@ -67,7 +67,7 @@ void putsAndGetsDataPerDomain() throws Exception { void getsDataForAllDomains() throws Exception { final H2DomainStatsData data = new H2DomainStatsData( File.createTempFile("testAll", "tempAll") - ); + ).init(); final String first = "test-put-domain1"; final String second = "test-put-domain2"; data.put( diff --git a/s3auth-hosts/src/test/java/com/s3auth/hosts/HtpasswdTest.java b/s3auth-hosts/src/test/java/com/s3auth/hosts/HtpasswdTest.java index 5c73df49..d2996e1c 100644 --- a/s3auth-hosts/src/test/java/com/s3auth/hosts/HtpasswdTest.java +++ b/s3auth-hosts/src/test/java/com/s3auth/hosts/HtpasswdTest.java @@ -62,7 +62,7 @@ void showsStatsInToStringWithIoException() { MatcherAssert.assertThat( new Htpasswd( new DefaultHost( - new BucketMocker().withClient(aws).mock(), + new BucketMocker().init().withClient(aws).mock(), this.cloudWatch() ) ), @@ -165,7 +165,7 @@ void ignoresBrokenLines() throws Exception { void worksWithDefaultHost() throws Exception { final Htpasswd htpasswd = new Htpasswd( new DefaultHost( - new BucketMocker().mock(), + new BucketMocker().init().mock(), () -> Mockito.mock(AmazonCloudWatchClient.class) ) ); @@ -182,8 +182,8 @@ void worksWithDefaultHost() throws Exception { * @throws Exception If there is some problem inside */ private Host host(final String htpasswd) throws Exception { - final Host host = Mockito.spy(new HostMocker().mock()); - Mockito.doReturn(new ResourceMocker().withContent(htpasswd).mock()) + final Host host = Mockito.spy(new HostMocker().init().mock()); + Mockito.doReturn(new ResourceMocker().init().withContent(htpasswd).mock()) .when(host) .fetch(URI.create("/.htpasswd"), Range.ENTIRE, Version.LATEST); return host; diff --git a/s3auth-hosts/src/test/java/com/s3auth/hosts/RejectingHostTest.java b/s3auth-hosts/src/test/java/com/s3auth/hosts/RejectingHostTest.java index f5df82c1..68c41e61 100644 --- a/s3auth-hosts/src/test/java/com/s3auth/hosts/RejectingHostTest.java +++ b/s3auth-hosts/src/test/java/com/s3auth/hosts/RejectingHostTest.java @@ -50,7 +50,7 @@ void rejectsByRegex() throws Exception { MatcherAssert.assertThat( ResourceMocker.toString( new RejectingHost( - new HostMocker().withContent(uri, "test me").mock(), + new HostMocker().init().withContent(uri, "test me").mock(), "/test/.*" ).fetch(uri, Range.ENTIRE, Version.LATEST) ), diff --git a/s3auth-hosts/src/test/java/com/s3auth/hosts/SmartHostTest.java b/s3auth-hosts/src/test/java/com/s3auth/hosts/SmartHostTest.java index 5e26cc25..1dc0e2c1 100644 --- a/s3auth-hosts/src/test/java/com/s3auth/hosts/SmartHostTest.java +++ b/s3auth-hosts/src/test/java/com/s3auth/hosts/SmartHostTest.java @@ -50,7 +50,7 @@ void showsLogsOfHtpasswdFetching() throws Exception { MatcherAssert.assertThat( ResourceMocker.toString( new SmartHost( - new HostMocker().withContent(uri, "test me").mock() + new HostMocker().init().withContent(uri, "test me").mock() ).fetch(uri, Range.ENTIRE, Version.LATEST) ), Matchers.equalTo("7 byte(s)") @@ -63,7 +63,7 @@ void showsLogsOfHtpasswdFetching() throws Exception { @Test void convertsItselfToString() { MatcherAssert.assertThat( - new SmartHost(new HostMocker().mock()), + new SmartHost(new HostMocker().init().mock()), Matchers.hasToString(Matchers.notNullValue()) ); } diff --git a/s3auth-hosts/src/test/java/com/s3auth/hosts/SyslogHostsTest.java b/s3auth-hosts/src/test/java/com/s3auth/hosts/SyslogHostsTest.java index cb2baad1..be8f28fa 100644 --- a/s3auth-hosts/src/test/java/com/s3auth/hosts/SyslogHostsTest.java +++ b/s3auth-hosts/src/test/java/com/s3auth/hosts/SyslogHostsTest.java @@ -58,10 +58,10 @@ final class SyslogHostsTest { @Test void returnsUnderlyingDomains() throws Exception { final Hosts hosts = Mockito.mock(Hosts.class); - final Domain first = new DomainMocker().mock(); - final Domain second = new DomainMocker().mock(); + final Domain first = new DomainMocker().init().mock(); + final Domain second = new DomainMocker().init().mock(); final Set domains = new HashSet<>(Arrays.asList(first, second)); - final User user = new UserMocker().mock(); + final User user = new UserMocker().init().mock(); Mockito.doReturn(domains).when(hosts).domains(user); @SuppressWarnings("resource") final SyslogHosts syslog = new SyslogHosts(hosts); @@ -103,6 +103,7 @@ public void event(final SyslogServerIF syslg, final Hosts hosts = Mockito.mock(Hosts.class); final String path = "/path/to/fetch"; final Host host = new HostMocker() + .init() .withContent(URI.create(path), "blah") .withSyslog(String.format("localhost:%d", port)) .mock(); diff --git a/s3auth-relay/src/main/java/com/s3auth/relay/HttpRequest.java b/s3auth-relay/src/main/java/com/s3auth/relay/HttpRequest.java index 2bbda213..d364ef5c 100644 --- a/s3auth-relay/src/main/java/com/s3auth/relay/HttpRequest.java +++ b/s3auth-relay/src/main/java/com/s3auth/relay/HttpRequest.java @@ -275,7 +275,7 @@ private Map> parseHeaders( final String name = matcher.group(1).trim().toLowerCase(Locale.ENGLISH); if (!map.containsKey(name)) { - map.put(name, Lists.newLinkedList()); + map.put(name, Lists.newLinkedList()); } map.get(name).add(matcher.group(2)); } @@ -295,7 +295,7 @@ private Map> parseParameters( while (matcher.find()) { final String name = matcher.group(1).trim(); if (!map.containsKey(name)) { - map.put(name, Lists.newLinkedList()); + map.put(name, Lists.newLinkedList()); } map.get(name).add( StringUtils.defaultString(matcher.group(Tv.THREE)) diff --git a/s3auth-relay/src/test/java/com/s3auth/relay/HttpFacadeTest.java b/s3auth-relay/src/test/java/com/s3auth/relay/HttpFacadeTest.java index 5949b8cd..448d17c3 100644 --- a/s3auth-relay/src/test/java/com/s3auth/relay/HttpFacadeTest.java +++ b/s3auth-relay/src/test/java/com/s3auth/relay/HttpFacadeTest.java @@ -431,7 +431,7 @@ void getsCompressedContent() throws Exception { Mockito.doAnswer( (Answer) inv -> { final Resource answer = Mockito.spy( - new ResourceMocker() + new ResourceMocker().init() .withContent(body) .withHeaders("gzip") .mock() @@ -511,7 +511,7 @@ public void getsContentOverSSL() throws Exception { ); final Host host = Mockito.mock(Host.class); final String body = "secured"; - final Resource answer = new ResourceMocker().withContent(body).mock(); + final Resource answer = new ResourceMocker().init().withContent(body).mock(); Mockito.doReturn(answer).when(host).fetch( Mockito.any(URI.class), Mockito.any(Range.class), @@ -548,7 +548,7 @@ public void getsContentOverSSL() throws Exception { @Test void closesUnderlyingResource() throws Exception { final Host host = Mockito.mock(Host.class); - final Resource resource = Mockito.spy(new ResourceMocker().mock()); + final Resource resource = Mockito.spy(new ResourceMocker().init().mock()); Mockito.doReturn(resource).when(host).fetch( Mockito.any(URI.class), Mockito.any(Range.class), @@ -588,7 +588,7 @@ void closesUnderlyingResource() throws Exception { void servicesHeadMethod() throws Exception { final Host host = Mockito.mock(Host.class); final Resource resource = Mockito.spy( - new ResourceMocker() + new ResourceMocker().init() .withContent("should not appear in body") .mock() ); diff --git a/s3auth-relay/src/test/java/com/s3auth/relay/HttpRequestTest.java b/s3auth-relay/src/test/java/com/s3auth/relay/HttpRequestTest.java index 86a750a0..a8b42818 100644 --- a/s3auth-relay/src/test/java/com/s3auth/relay/HttpRequestTest.java +++ b/s3auth-relay/src/test/java/com/s3auth/relay/HttpRequestTest.java @@ -169,7 +169,7 @@ void fetchesDuplicateQueryParams() throws Exception { MatcherAssert.assertThat( request.parameters().get("first"), Matchers.allOf( - Matchers.iterableWithSize(2), + Matchers.iterableWithSize(2), Matchers.hasItems("one", "three") ) ); diff --git a/s3auth-relay/src/test/java/com/s3auth/relay/SecuredHostTest.java b/s3auth-relay/src/test/java/com/s3auth/relay/SecuredHostTest.java index 579be6f9..e4a35717 100644 --- a/s3auth-relay/src/test/java/com/s3auth/relay/SecuredHostTest.java +++ b/s3auth-relay/src/test/java/com/s3auth/relay/SecuredHostTest.java @@ -68,7 +68,7 @@ void requestsAuthorization() throws Exception { for (final String name : hosts) { try { new SecuredHost( - new HostMocker().mock(), + new HostMocker().init().mock(), HttpRequestMocker.toRequest( String.format("GET / HTTP/1.1\nHost: %s\n\n", name) ) @@ -102,7 +102,7 @@ void requestsAuthorizationWhenBrokenData() throws Exception { for (final String http : requests) { try { new SecuredHost( - new HostMocker().mock(), + new HostMocker().init().mock(), HttpRequestMocker.toRequest(http) ).fetch(URI.create("/test.html"), Range.ENTIRE, Version.LATEST); Assert.fail("exception expected, but didn't happen");