+ "\nhttps://github.com/SpringSource/spring-integration-extensions"
+ "\n "
+ "\n=========================================================" );
}
final GenericXmlApplicationContext context = new GenericXmlApplicationContext();
System.out.println("Please enter the: ");
System.out.println("\t- SMB Host");
System.out.println("\t- SMB Share and Directory");
System.out.println("\t- SMB Username");
System.out.println("\t- SMB Password");
System.out.print("Host: ");
final String host = scanner.nextLine();
System.out.print("Share and Directory (e.g. myFile/path/to/): ");
final String shareAndDir = scanner.nextLine();
System.out.print("Username (e.g. guest): ");
final String username = scanner.nextLine();
System.out.print("Password (can be empty): ");
final String password = scanner.nextLine();
context.getEnvironment().getSystemProperties().put("host", host);
context.getEnvironment().getSystemProperties().put("shareAndDir", shareAndDir);
context.getEnvironment().getSystemProperties().put("username", username);
context.getEnvironment().getSystemProperties().put("password", password);
context.load("classpath:META-INF/spring/integration/*-context.xml");
context.registerShutdownHook();
context.refresh();
context.registerShutdownHook();
if (LOGGER.isInfoEnabled()) {
LOGGER.info("\n========================================================="
+ "\n "
+ "\n Please press 'q + Enter' to quit the application. "
+ "\n "
+ "\n=========================================================" );
}
SmbSessionFactory smbSessionFactory = context.getBean("smbSession", SmbSessionFactory.class);
System.out.println("Polling from Share: " + smbSessionFactory.getUrl());
while (true) {