Package org.apache.commons.cli

Examples of org.apache.commons.cli.MissingOptionException


        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"));
           
View Full Code Here


    }

    private static void configureDicomFileSet(DcmQRSCP main, CommandLine cl)
            throws ParseException {
        if (!cl.hasOption("dicomdir"))
            throw new MissingOptionException(rb.getString("missing-dicomdir"));
        main.setDicomDirectory(new File(cl.getOptionValue("dicomdir")));
        main.setFilePathFormat(cl.getOptionValue("filepath",
                        "DICOM/{0020000D,hash}/{0020000E,hash}/{00080018,hash}"));
        main.setRecordFactory(new RecordFactory());
    }
View Full Code Here

    private static void configureConnect(HL7Pix hl7pix, CommandLine cl)
            throws MissingOptionException, ParseException {
        String appAtHostPort = cl.getOptionValue("c");
        if (appAtHostPort == null)
            throw new MissingOptionException(
                    CLIUtils.rb.getString("missing-connect-opt"));

        String[] appHostPort = HL7Segment.split(appAtHostPort , '@');
        if (appHostPort.length != 2)
            throw new ParseException(CLIUtils.rb.getString("invalid-connect-opt"));
View Full Code Here

    }

    private static void configureBindServer(Connection conn, CommandLine cl)
            throws ParseException {
        if (!cl.hasOption("b"))
            throw new MissingOptionException(
                    CLIUtils.rb.getString("missing-bind-opt"));
        String aeAtHostPort = cl.getOptionValue("b");
        String[] hostAndPort = StringUtils.split(aeAtHostPort, ':');
        int portIndex = hostAndPort.length - 1;
        conn.setPort(Integer.parseInt(hostAndPort[portIndex]));
View Full Code Here

    @SuppressWarnings({ "unchecked" })
    public static void main(String[] args) {
        try {
            CommandLine cl = parseComandLine(args);
            if(cl.getArgList().isEmpty())
                throw new MissingOptionException(
                        rb.getString("missing-i-file"));
            final Device device = new Device("modality");
            final Connection conn = new Connection();
            final ApplicationEntity ae = new ApplicationEntity("MODALITY");
            checkOptions(cl);
View Full Code Here

        }
    }

    private static void checkOptions(CommandLine cl) throws ParseException {
        if (!cl.hasOption("b"))
            throw new MissingOptionException(
                    CLIUtils.rb.getString("missing-bind-opt"));
        if (!cl.hasOption("c"))
            throw new MissingOptionException(
                    CLIUtils.rb.getString("missing-connect-opt"));
        if (cl.hasOption("mpps") && cl.hasOption("mpps-late"))
            throw new ParseException(rb.getString("mpps-error"));
    }
View Full Code Here

        return mkkos.getFname();
    }

    private static String documentTitleOf(CommandLine cl) throws MissingOptionException {
        if (!cl.hasOption("kos-title"))
            throw new MissingOptionException(rb.getString("missing-title"));
        return cl.getOptionValue("kos-title");
    }
View Full Code Here

    }

    private static void configureBindServer(Connection conn, CommandLine cl)
            throws ParseException {
        if (!cl.hasOption("b"))
            throw new MissingOptionException(
                    CLIUtils.rb.getString("missing-bind-opt"));
        String aeAtHostPort = cl.getOptionValue("b");
        String[] hostAndPort = StringUtils.split(aeAtHostPort, ':');
        int portIndex = hostAndPort.length - 1;
        conn.setPort(Integer.parseInt(hostAndPort[portIndex]));
View Full Code Here

    }

    private static void configureConnect(Connection conn, CommandLine cl)
            throws MissingOptionException, ParseException {
        if (!cl.hasOption("c"))
            throw new MissingOptionException(
                    CLIUtils.rb.getString("missing-connect-opt"));

        String[] hostPort = StringUtils.split(cl.getOptionValue("c"), ':');
        if (hostPort.length != 2)
            throw new ParseException(CLIUtils.rb.getString("invalid-connect-opt"));
View Full Code Here

    }

    private static void configureConnect(Connection conn, CommandLine cl)
            throws MissingOptionException, ParseException {
        if (!cl.hasOption("c"))
            throw new MissingOptionException(
                    CLIUtils.rb.getString("missing-connect-opt"));

        String[] hostPort = StringUtils.split(cl.getOptionValue("c"), ':');
        if (hostPort.length != 2)
            throw new ParseException(CLIUtils.rb.getString("invalid-connect-opt"));
View Full Code Here

TOP

Related Classes of org.apache.commons.cli.MissingOptionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.