Use S3PersistentAcceptOnceFLFilter by default

To avoid some local work with files, add `S3PersistentAcceptOnceFileListFilter` to the `S3InboundFileSynchronizer` as a default one

* Upgrade to Gradle 3.1
* Upgrade to SI-4.3.2
* Some `build.gradle` polishing
* Downgrade to Checkstyle-6.16.1 because of `RequireThis` bug
This commit is contained in:
Artem Bilan
2016-09-19 17:22:42 -04:00
parent f5a6b1c44c
commit b1a6b59dab
8 changed files with 33 additions and 19 deletions

View File

@@ -8,17 +8,16 @@ buildscript {
}
plugins {
id "org.sonarqube" version "1.2"
id 'java'
id 'eclipse'
id 'idea'
id 'jacoco'
id 'org.sonarqube' version '1.2'
id 'checkstyle'
}
description = 'Spring Integration AWS Support'
apply plugin: 'java'
apply from: "${rootProject.projectDir}/publish-maven.gradle"
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
group = 'org.springframework.integration'
@@ -56,7 +55,7 @@ ext {
servletApiVersion = '3.1.0'
slf4jVersion = '1.7.21'
springCloudAwsVersion = '1.1.1.RELEASE'
springIntegrationVersion = '4.3.1.RELEASE'
springIntegrationVersion = '4.3.2.RELEASE'
idPrefix = 'aws'
@@ -77,8 +76,8 @@ jacoco {
}
checkstyle {
configFile = file('src/checkstyle/checkstyle.xml')
toolVersion = "7.1"
configFile = file("${rootDir}/src/checkstyle/checkstyle.xml")
toolVersion = "6.16.1"
}
dependencies {

Binary file not shown.

View File

@@ -1,6 +1,6 @@
#Thu Jun 23 12:52:13 EDT 2016
#Mon Sep 19 16:49:42 EDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-bin.zip

5
gradlew vendored
View File

@@ -161,4 +161,9 @@ function splitJvmOpts() {
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

6
gradlew.bat vendored
View File

@@ -49,7 +49,6 @@ goto fail
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
@@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line

View File

@@ -68,7 +68,6 @@
<module name="MultipleVariableDeclarations" />
<module name="RequireThis">
<property name="checkMethods" value="false" />
<property name="validateOnlyOverlapping" value="false" />
</module>
<module name="OneStatementPerLine" />

View File

@@ -16,11 +16,15 @@
package org.springframework.integration.aws.inbound;
import org.springframework.expression.Expression;
import org.springframework.expression.common.LiteralExpression;
import org.springframework.integration.aws.support.S3SessionFactory;
import org.springframework.integration.aws.support.filters.S3PersistentAcceptOnceFileListFilter;
import org.springframework.integration.file.filters.FileListFilter;
import org.springframework.integration.file.remote.session.Session;
import org.springframework.integration.file.remote.session.SessionFactory;
import org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer;
import org.springframework.integration.metadata.SimpleMetadataStore;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.model.S3ObjectSummary;
@@ -47,6 +51,17 @@ public class S3InboundFileSynchronizer extends AbstractInboundFileSynchronizer<S
public S3InboundFileSynchronizer(SessionFactory<S3ObjectSummary> sessionFactory) {
super(sessionFactory);
setRemoteDirectoryExpression(new LiteralExpression(null));
setFilter(new S3PersistentAcceptOnceFileListFilter(new SimpleMetadataStore(), "s3MessageSource"));
}
@Override
public final void setRemoteDirectoryExpression(Expression remoteDirectoryExpression) {
super.setRemoteDirectoryExpression(remoteDirectoryExpression);
}
@Override
public final void setFilter(FileListFilter<S3ObjectSummary> filter) {
super.setFilter(filter);
}
@Override

View File

@@ -25,7 +25,9 @@ import com.amazonaws.services.s3.model.S3ObjectSummary;
/**
* An Amazon S3 {@link org.springframework.integration.file.remote.FileInfo} implementation.
*
* @author Christian Tzolov
*
* @since 1.1
*/
public class S3FileInfo extends AbstractFileInfo<S3ObjectSummary> {