diff --git a/spring-integration-smb/build.gradle b/spring-integration-smb/build.gradle index 4475f4c..9605da3 100644 --- a/spring-integration-smb/build.gradle +++ b/spring-integration-smb/build.gradle @@ -13,7 +13,7 @@ plugins { id 'idea' id 'jacoco' id 'checkstyle' - id 'org.sonarqube' version '2.7' + id 'org.sonarqube' version '2.8' } description = 'Spring Integration SMB Support' @@ -42,9 +42,9 @@ compileTestJava { ext { idPrefix = 'smb' - jcifsVersion = '2.1.8' - log4jVersion = '2.11.2' - springIntegrationVersion = '5.2.0.BUILD-SNAPSHOT' + jcifsVersion = '2.1.11' + log4jVersion = '2.12.1' + springIntegrationVersion = '5.2.1.BUILD-SNAPSHOT' linkHomepage = 'https://github.com/SpringSource/spring-integration-extensions' @@ -67,12 +67,12 @@ sourceSets { } jacoco { - toolVersion = "0.8.2" + toolVersion = '0.8.4' } checkstyle { configFile = file("$rootDir/src/checkstyle/checkstyle.xml") - toolVersion = "8.19" + toolVersion = '8.25' } dependencies { @@ -81,7 +81,7 @@ dependencies { testCompile "org.springframework.integration:spring-integration-test:$springIntegrationVersion" - testRuntime "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion" +// testRuntime "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion" testRuntime "org.apache.logging.log4j:log4j-jcl:$log4jVersion" } @@ -92,14 +92,14 @@ jacocoTestReport { reports { xml.enabled false csv.enabled false - html.destination "${buildDir}/reports/jacoco/html" + html.destination file("${buildDir}/reports/jacoco/html") } } test { // suppress all console output during testing unless running `gradle -i` logging.captureStandardOutput(LogLevel.INFO) - maxHeapSize = "1024m" + maxHeapSize = '1024m' jacoco { append = false destinationFile = file("$buildDir/jacoco.exec") diff --git a/spring-integration-smb/gradle/wrapper/gradle-wrapper.jar b/spring-integration-smb/gradle/wrapper/gradle-wrapper.jar index 91ca28c..5c2d1cf 100644 Binary files a/spring-integration-smb/gradle/wrapper/gradle-wrapper.jar and b/spring-integration-smb/gradle/wrapper/gradle-wrapper.jar differ diff --git a/spring-integration-smb/gradle/wrapper/gradle-wrapper.properties b/spring-integration-smb/gradle/wrapper/gradle-wrapper.properties index 16d2805..f04d6a2 100644 --- a/spring-integration-smb/gradle/wrapper/gradle-wrapper.properties +++ b/spring-integration-smb/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/spring-integration-smb/gradlew b/spring-integration-smb/gradlew index cccdd3d..83f2acf 100755 --- a/spring-integration-smb/gradlew +++ b/spring-integration-smb/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -109,8 +125,8 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` diff --git a/spring-integration-smb/gradlew.bat b/spring-integration-smb/gradlew.bat index e95643d..24467a1 100644 --- a/spring-integration-smb/gradlew.bat +++ b/spring-integration-smb/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/spring-integration-smb/src/main/java/org/springframework/integration/smb/inbound/SmbInboundFileSynchronizer.java b/spring-integration-smb/src/main/java/org/springframework/integration/smb/inbound/SmbInboundFileSynchronizer.java index 18b6255..eac783a 100644 --- a/spring-integration-smb/src/main/java/org/springframework/integration/smb/inbound/SmbInboundFileSynchronizer.java +++ b/spring-integration-smb/src/main/java/org/springframework/integration/smb/inbound/SmbInboundFileSynchronizer.java @@ -59,4 +59,9 @@ public class SmbInboundFileSynchronizer extends AbstractInboundFileSynchronizer< return file.getLastModified(); } + @Override + protected String protocol() { + return "smb"; + } + } diff --git a/spring-integration-smb/src/main/java/org/springframework/integration/smb/session/SmbSession.java b/spring-integration-smb/src/main/java/org/springframework/integration/smb/session/SmbSession.java index 90d1be8..fbd15d0 100644 --- a/spring-integration-smb/src/main/java/org/springframework/integration/smb/session/SmbSession.java +++ b/spring-integration-smb/src/main/java/org/springframework/integration/smb/session/SmbSession.java @@ -22,6 +22,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.net.URL; import java.util.Arrays; import org.apache.commons.logging.Log; @@ -273,7 +274,8 @@ public class SmbSession implements Session { if (!dir.exists()) { dir.mkdirs(); if (logger.isInfoEnabled()) { - logger.info("Successfully created remote directory [" + _path + "] in share [" + this.smbShare + "]."); + logger.info("Successfully created remote directory [" + _path + "] in share [" + this.smbShare + "]" + + "."); } } else { @@ -495,6 +497,12 @@ public class SmbSession implements Session { return createSmbFileObject(_path, true); } + @Override + public String getHostPort() { + URL url = this.smbShare.getURL(); + return url.getHost() + ":" + url.getPort(); + } + @Override public String[] listNames(String path) { throw new UnsupportedOperationException("Not implemented yet");