class CmdLineExecutor implements CliAdapter, Callable<CliResult> {

    @Override
    public CliResult execute(String... args) throws Exception {
        final StoreLoader storeLoader = storeType.getLoader();

        storeLoader.load(inputpath);

        final DataExporter dataExporter;
        if (exportType == ExportType.JDBC) {
            if (dbconfig == null) {
                throw new IllegalArgumentException("dbconfig file path is required when no export type is defined.");
            }

            final Properties properties = new Properties();
            try (InputStream inStream = Files.newInputStream(dbconfig)) {
                properties.load(inStream);
            }

            final String insertRow =
                    Objects.requireNonNull(
                            properties.getProperty("insertRow"), "No insertRow value defined in config file. ");
            final String createTable =
                    Objects.requireNonNull(
                            properties.getProperty("createTable"), "No createTable value defined in config file. ");
            final String jdbcUrl =
                    Objects.requireNonNull(
                            properties.getProperty("jdbcUrl"), "No jdbcUrl value defined in config file. ");

            dataExporter = new JdbcDataExporter(jdbcUrl, insertRow, singletonList(createTable));

        } else {
            dataExporter = DataExporterFactory.create(exportType);
        }

        dataExporter.export(storeLoader, outputFile, username, password);

        System.out.printf("Exported data to %s", Objects.toString(outputFile));
        System.out.println();

        return new CliResult(0, true, null);
    }

}