LOG.info("Using default configuration....");
server = new FtpServer();
}
else if( args.length == 2 ) {
LOG.info("Using xml configuration file " + args[1] + "...");
XmlBeanFactory bf = new XmlBeanFactory(new FileSystemResource(args[1]));
if(bf.containsBean("server")) {
server = (FtpServer) bf.getBean("server");
} else {
String[] beanNames = bf.getBeanNamesForType(FtpServer.class);
if(beanNames.length == 1) {
server = (FtpServer) bf.getBean(beanNames[0]);
} else if(beanNames.length > 1) {
System.out.println("Using the first server defined in the configuration, named " + beanNames[0]);
server = (FtpServer) bf.getBean(beanNames[0]);
} else {
System.err.println("XML configuration does not contain a server configuration");
}
}
} else {