/**
* Get the configuration object.
*/
private static FtpServer getConfiguration(String[] args) throws Exception {
FtpServer server = null;
if(args == null || args.length < 2) {
LOG.info("Using default configuration....");
server = new FtpServer();
} else if( (args.length == 2) && args[1].equals("-default") ) {
// supported for backwards compatibility, but not documented
System.out.println("The -default switch is deprecated, please use --default instead");
LOG.info("Using default configuration....");
server = new FtpServer();
} else if( (args.length == 2) && args[1].equals("--default") ) {
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")) {