List<String> ret = new ArrayList<>(); ret.addAll(Arrays.asList(files.executable().getAbsolutePath())); if (config.cmdOptions().isVerbose()) { ret.add("-v"); Net net = config.net(); ret.add("--port"); ret.add("" + net.getPort()); if (config.getDatabaseName()!=null) { ret.add("--db"); ret.add(config.getDatabaseName()); if (config.getCollectionName()!=null) { ret.add("--collection"); ret.add(config.getCollectionName()); if (config.isJsonArray()) { ret.add("--jsonArray"); if (config.isDropCollection()) { ret.add("--drop"); if (config.isUpsertDocuments()) { ret.add("--upsert"); if (config.getImportFile()!=null) { ret.add("--file"); ret.add(config.getImportFile());
private void waitFor(MongoImportProcess importProcess) throws InterruptedException, MojoExecutionException { int code = importProcess.waitFor(); if(code != 0){ throw new MojoExecutionException("Cannot import '" + importProcess.getConfig().getImportFile() + "'"); } getLog().info("Import return code: " + code); }
private void waitFor(MongoImportProcess importProcess) throws InterruptedException, MojoExecutionException { int code = importProcess.waitFor(); if(code != 0){ throw new MojoExecutionException("Cannot import '" + importProcess.getConfig().getImportFile() + "'"); } getLog().info("Import return code: " + code); }