public static void main(String[] args) {

		OptionBuilder.withArgName("Service");
		OptionBuilder.hasArg();
		OptionBuilder.withDescription("Service type Exchange (MX) or Vault (DX)");
		Option numRecs = OptionBuilder.create("s");

		
		Options options = new Options();
		
		options.addOption(numRecs);
		
		CommandLineParser parser = new PosixParser();
		try {
			CommandLine line = parser.parse( options, args);
			if(line.hasOption("s"))
			{

				Service = line.getOptionValue('s');
			}
			else
			{
				Quit(options);
			}
		}
		catch (ParseException e)
		{
			System.out.println("Parse Exception : " + e.getMessage());
		}
		
		
		Properties properties = new Properties();
//		ClassLoader classLoader = Thread.currentThread().getContextClassLoader();

		InputStream is;
		try {
			is = new FileInputStream("xio.properties");
			try {
				properties.load(is);
			 	is.close();
			 } catch (IOException ioe) {
				 System.out.print(ioe.getMessage());
			 }
			catch (Exception e){
				System.out.print(e.getMessage());
			}
			
			VaultUserFolder= properties.getProperty("VaultUserFolder");
			xioFolder = properties.getProperty("xioFolder");
			
			// Added 24 Sept 2014 
			// First make sure the xio folder structure is in place
			new File(xioFolder + "/loaded").mkdirs();
			new File(xioFolder + "/send").mkdirs();
			new File(xioFolder + "/sent").mkdirs();
			new File(VaultUserFolder).mkdirs();
			
		} catch (FileNotFoundException e1) {
			System.out.println(e1.getMessage());
			
		}
		
		
		helper =  new DatabaseHelper();
		filesToProcess = listFilesForFolder(xioFolder + "/sent");
		if(filesToProcess.isEmpty())
		{
			System.out.println("No Files to process");
		}
		else
		{
			for(Path p : filesToProcess)
			{
				try {
					processInputFile(p);
				} catch (IOException e) {	
					System.out.println(e.getMessage());
				}
			}
		}
		
	}