public void parseAndExecute(String[] args) {
        initOptions(options);
        // create the parser
        CommandLineParser parser = new GnuParser();
        try {
            // parse the command line arguments
            CommandLine line = parser.parse(options, args);
            parse(line);
        }
        catch (Exception exp) {
            // oops, something went wrong
            System.err.println("Parsing failed.  Reason: " + exp.getMessage());
            return;
        }


        try {
            execute();
        }
        catch (Exception e) {
            // oops, something went wrong
            System.err.println("Execution failed.  Reason: " + e.getMessage());
        }
        finally {
            IOUtils.closeQuietly(inputStream);
            IOUtils.closeQuietly(out);
        }
    }