public static Object addFile(MongoConnector dbc, String jar) throws FileNotFoundException, URISyntaxException { URL path = ClassLoader.getSystemResource(jar); File f = new File(path.toURI()); return dbc.getPipelineWriter().save(f.getName(), new FileInputStream(f)); } }
public static Object addFile(MongoConnector dbc, String jar, String id) throws FileNotFoundException, URISyntaxException { URL path = ClassLoader.getSystemResource(jar); File f; if (path == null) { f = new File(jar); if (!f.exists()) { System.out.println("Unable to locate file " + jar); return null; } } else { f = new File(path.toURI()); } if (id == null) { return dbc.getPipelineWriter().save(f.getName(), new FileInputStream(f)); } dbc.getPipelineWriter().save(id, f.getName(), new FileInputStream(f)); return id; } }
mdc.getPipelineWriter().write(pipeline); System.out.println("Removed "+stagesToDelete.size()+" stages from the pipeline"); boolean res = mdc.getPipelineWriter().deleteFile(cmd.getOptionValue("i")); if(res) { System.out.println("Removed library file with id "+cmd.getOptionValue("i"));
public static void removeStage(MongoConnector mdc, CommandLine cmd) throws IOException { if(!cmd.hasOption("n")) { System.out.println("No stage name specified\n"); printUsage(cmd); return; } String name = cmd.getOptionValue("n"); Pipeline pipeline = mdc.getPipelineReader().getPipeline(); if(pipeline.getStage(name) == null) { System.out.println("Specified stage '"+name+"' did not exist\n"); return; } boolean found = false; for(StageGroup g : pipeline.getStageGroups()) { if(g.hasStage(name)) { g.removeStage(name); found = true; break; } } if(found) { mdc.getPipelineWriter().write(pipeline); System.out.println("Successfully removed stage '"+name+"'"); } else { System.out.println("Unable to delete '"+name+"'. Stage did not exist."); } }
g.addStage(s); pipeline.addGroup(g); mdc.getPipelineWriter().write(pipeline); System.out.println("Added stage " + name + " to the pipeline.");
s.setProperties(map); mdc.getPipelineWriter().write(c);
mdc.getPipelineWriter().save(cmd.getJarFile().getId(), file.getName(), new FileInputStream(f)); mdc.getPipelineWriter().write(pipeline);