public IOD get(String uri) throws IOException { IOD iod = map.get(uri); if (iod == null) map.put(uri, iod = IOD.load(uri)); return iod; } }
private static void configureIODs(MppsSCP main, CommandLine cl) throws IOException { if (!cl.hasOption("no-validate")) { main.setMppsNCreateIOD(IOD.load( cl.getOptionValue("mpps-ncreate-iod", "resource:mpps-ncreate-iod.xml"))); main.setMppsNSetIOD(IOD.load( cl.getOptionValue("mpps-nset-iod", "resource:mpps-nset-iod.xml"))); } }
@SuppressWarnings("unchecked") public static void main(String[] args) { try { CommandLine cl = parseComandLine(args); DcmValidate main = new DcmValidate(); String iodFile = cl.getOptionValue("iod"); if (iodFile == null) throw new MissingOptionException(Arrays.asList("iod")); main.setIOD(IOD.load(iodFile)); List<String> fnames = cl.getArgList(); if (fnames.isEmpty()) throw new ParseException(rb.getString("missing")); for (String fname : fnames) validate(main, new File(fname)); } catch (ParseException e) { System.err.println("DcmValidate: " + e.getMessage()); System.err.println(rb.getString("try")); System.exit(2); } catch (IOException e) { System.err.println("DcmValidate: " + e.getMessage()); System.exit(2); } }
@SuppressWarnings("unchecked") public static void main(String[] args) { try { CommandLine cl = parseComandLine(args); DcmValidate main = new DcmValidate(); String iodFile = cl.getOptionValue("iod"); if (iodFile == null) throw new MissingOptionException(Arrays.asList("iod")); main.setIOD(IOD.load(iodFile)); List<String> fnames = cl.getArgList(); if (fnames.isEmpty()) throw new ParseException(rb.getString("missing")); for (String fname : fnames) validate(main, new File(fname)); } catch (ParseException e) { System.err.println("DcmValidate: " + e.getMessage()); System.err.println(rb.getString("try")); System.exit(2); } catch (IOException e) { System.err.println("DcmValidate: " + e.getMessage()); System.exit(2); } }