Upgrade Zip sample to the latest dependencies
This commit is contained in:
Binary file not shown.
@@ -12,9 +12,9 @@
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<spring.integration.zip.version>1.0.2.RELEASE</spring.integration.zip.version>
|
||||
<log4j.version>2.13.0</log4j.version>
|
||||
<junit.version>4.13.1</junit.version>
|
||||
<spring.integration.zip.version>2.0.0</spring.integration.zip.version>
|
||||
<log4j.version>2.17.2</log4j.version>
|
||||
<junit.version>4.13.2</junit.version>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
@@ -30,10 +30,10 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<version>3.10.1</version>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<compilerArgument>-Xlint:all</compilerArgument>
|
||||
<showWarnings>true</showWarnings>
|
||||
<showDeprecation>true</showDeprecation>
|
||||
@@ -42,7 +42,7 @@
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<version>3.0.0</version>
|
||||
<configuration>
|
||||
<mainClass>org.springframework.integration.samples.zip.Main</mainClass>
|
||||
</configuration>
|
||||
@@ -88,7 +88,7 @@
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.7</version>
|
||||
<version>2.11.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -39,7 +39,8 @@ public final class Main {
|
||||
|
||||
private static final Log LOGGER = LogFactory.getLog(Main.class);
|
||||
|
||||
private Main() { }
|
||||
private Main() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the Spring Integration Application Context
|
||||
@@ -50,13 +51,13 @@ public final class Main {
|
||||
|
||||
if (LOGGER.isInfoEnabled()) {
|
||||
LOGGER.info("\n========================================================="
|
||||
+ "\n "
|
||||
+ "\n Welcome to the Spring Integration Zip Sample "
|
||||
+ "\n "
|
||||
+ "\n For more information please visit: "
|
||||
+ "\n https://www.springsource.org/spring-integration "
|
||||
+ "\n "
|
||||
+ "\n=========================================================" );
|
||||
+ "\n "
|
||||
+ "\n Welcome to the Spring Integration Zip Sample "
|
||||
+ "\n "
|
||||
+ "\n For more information please visit: "
|
||||
+ "\n https://www.springsource.org/spring-integration "
|
||||
+ "\n "
|
||||
+ "\n=========================================================");
|
||||
}
|
||||
|
||||
final AbstractApplicationContext context =
|
||||
@@ -70,23 +71,21 @@ public final class Main {
|
||||
|
||||
if (LOGGER.isInfoEnabled()) {
|
||||
LOGGER.info("\n========================================================="
|
||||
+ "\n "
|
||||
+ "\n Please press 'q + Enter' to quit the application. "
|
||||
+ "\n "
|
||||
+ "\n=========================================================" );
|
||||
+ "\n "
|
||||
+ "\n Please press 'q + Enter' to quit the application. "
|
||||
+ "\n "
|
||||
+ "\n=========================================================");
|
||||
}
|
||||
|
||||
while (!scanner.hasNext("q")) {
|
||||
//Do nothing unless user presses 'q' to quit.
|
||||
while (true) {
|
||||
if (scanner.hasNext("q")) {
|
||||
if (LOGGER.isInfoEnabled()) {
|
||||
LOGGER.info("Exiting application...bye.");
|
||||
}
|
||||
scanner.close();
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (LOGGER.isInfoEnabled()) {
|
||||
LOGGER.info("Exiting application...bye.");
|
||||
}
|
||||
|
||||
scanner.close();
|
||||
System.exit(0);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -50,9 +50,9 @@ public final class SpringIntegrationUtils {
|
||||
*/
|
||||
public static void displayDirectories(final ApplicationContext context) {
|
||||
|
||||
final Map<String, FileReadingMessageSource> fileReadingMessageSources = context.getBeansOfType(FileReadingMessageSource.class);
|
||||
Map<String, FileReadingMessageSource> fileReadingMessageSources = context.getBeansOfType(FileReadingMessageSource.class);
|
||||
|
||||
final List<String> inputDirectories = new ArrayList<String>();
|
||||
List<String> inputDirectories = new ArrayList<>();
|
||||
|
||||
for (FileReadingMessageSource source : fileReadingMessageSources.values()) {
|
||||
final File inDir = (File) new DirectFieldAccessor(source).getPropertyValue("directory");
|
||||
@@ -60,9 +60,9 @@ public final class SpringIntegrationUtils {
|
||||
}
|
||||
|
||||
|
||||
final Map<String, FileWritingMessageHandler> fileWritingMessageHandlers = context.getBeansOfType(FileWritingMessageHandler.class);
|
||||
Map<String, FileWritingMessageHandler> fileWritingMessageHandlers = context.getBeansOfType(FileWritingMessageHandler.class);
|
||||
|
||||
final List<String> outputDirectories = new ArrayList<String>();
|
||||
List<String> outputDirectories = new ArrayList<>();
|
||||
|
||||
for (final FileWritingMessageHandler messageHandler : fileWritingMessageHandlers.values()) {
|
||||
final Expression outDir = (Expression) new DirectFieldAccessor(messageHandler).getPropertyValue("destinationDirectoryExpression");
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.integration.samples.zip.SpringIntegrationUtils;
|
||||
public class SpringIntegrationProjectStartupTest {
|
||||
|
||||
@Test
|
||||
public void testStartupOfSpringInegrationContext() throws Exception{
|
||||
public void testStartupOfSpringIntegrationContext() throws Exception{
|
||||
final ApplicationContext context
|
||||
= new ClassPathXmlApplicationContext("/META-INF/spring/integration/spring-integration-context.xml",
|
||||
SpringIntegrationProjectStartupTest.class);
|
||||
|
||||
Reference in New Issue
Block a user