Package arq.cmd

Examples of arq.cmd.CmdException


            String[] x = getValue(argRepeat).split(",") ;
            if ( x.length == 1 )
            {
                try { repeatCount = Integer.parseInt(x[0]) ; }
                catch (NumberFormatException ex)
                { throw new CmdException("Can't parse "+x[0]+" in arg "+getValue(argRepeat)+" as an integer") ; }
               
            }
            else if ( x.length == 2 )
            {
                try { warmupCount = Integer.parseInt(x[0]) ; }
                catch (NumberFormatException ex)
                { throw new CmdException("Can't parse "+x[0]+" in arg "+getValue(argRepeat)+" as an integer") ; }
                try { repeatCount = Integer.parseInt(x[1]) ; }
                catch (NumberFormatException ex)
                { throw new CmdException("Can't parse "+x[1]+" in arg "+getValue(argRepeat)+" as an integer") ; }
            }
            else
                throw new CmdException("Wrong format for repeat count: "+getValue(argRepeat)) ;
        }
        if ( isVerbose() )
            ARQ.getContext().setTrue(ARQ.symLogExec) ;
       
        if ( hasArg(argExplain) )
            ARQ.setExecutionLogging(Explain.InfoLevel.ALL) ;
       
        if ( hasArg(argOptimize) )
        {
            String x1 = getValue(argOptimize) ;
            if ( hasValueOfTrue(argOptimize) || x1.equalsIgnoreCase("on") || x1.equalsIgnoreCase("yes") )
                queryOptimization = true ;
            else if ( hasValueOfFalse(argOptimize) || x1.equalsIgnoreCase("off") || x1.equalsIgnoreCase("no") )
                queryOptimization = false ;
            else throw new CmdException("Optimization flag must be true/false/on/off/yes/no. Found: "+getValue(argOptimize)) ;
        }
    }
View Full Code Here


            ex.printStackTrace(System.err) ;
        }
        catch (QueryException qEx)
        {
            //System.err.println(qEx.getMessage()) ;
            throw new CmdException("Query Exeception", qEx) ;
        }
        catch (JenaException | CmdException ex) { throw ex ; }
        catch (Exception ex)
        {
            throw new CmdException("Exception", ex) ;
        }
    }   
View Full Code Here

    @Override
    protected void exec()
    {
        if ( modRemote.getServiceURL() == null )
        {
            throw new CmdException("No endpoint given") ;
        }
        String endpoint = modRemote.getServiceURL() ;

        for ( String filename : requestFiles )
        {
View Full Code Here

    @Override
    protected void processModulesAndArgs()
    {
        if ( containsMultiple(graphNameArg) )
            throw new CmdException("At most one --graph allowed") ;
       
        graphName = getValue(graphNameArg) ;
        loadFiles = super.getPositional() ;
        dump = contains(dumpArg) ;
        super.processModulesAndArgs() ;
View Full Code Here

    @Override
    protected void execUpdate(GraphStore graphStore)
    {
        if ( loadFiles.size() == 0 )
            throw new CmdException("Nothing to do") ;
       
        UpdateRequest req = new UpdateRequest() ;
        for ( String filename : loadFiles )
        {
            UpdateLoad loadReq = new UpdateLoad( filename, graphName );
View Full Code Here

           
            if ( (graphURLs != null) || (namedGraphURLs != null) )
                ds = DatasetUtils.addInGraphs(ds, graphURLs, namedGraphURLs, null) ;
        }
        catch (LabelExistsException ex)
        { throw new CmdException(ex.getMessage()) ; }
        catch (JenaException ex)
        { throw ex ; }
        catch (Exception ex)
        { throw new CmdException("Error creating dataset", ex) ; }
    }
View Full Code Here

            {
                printNone = true;
            }
            else
            {
                throw new CmdException(
                    "Not a recognized print form: " + arg + " : Choices are: query, op, quad, opt, optquad" );
            }
        }
       
        if ( !printUpdate && ! printNone )
View Full Code Here

            cl.process() ;
        } catch (IllegalArgumentException ex)
        {
            System.err.println(ex.getMessage()) ;
            usage(System.err) ;
            throw new CmdException() ;
        }

        if ( cl.contains(helpDecl) )
        {
            usage() ;
View Full Code Here

            {
                printNone = true;
            }
            else
            {
                throw new CmdException(
                    "Not a recognized print form: " + arg + " : Choices are: query, op, quad, opt, optquad" );
            }
        }
       
        if ( ! printQuery && ! printOp && ! printQuad && ! printPlan && ! printOpt && ! printQuadOpt && ! printNone )
View Full Code Here

            ex.printStackTrace(System.err) ;
        }
        catch (QueryException qEx)
        {
            //System.err.println(qEx.getMessage()) ;
            throw new CmdException("Query Exeception", qEx) ;
        }
        catch (JenaException ex) {
            ex.printStackTrace() ;
            throw ex ; }
        catch (CmdException ex) { throw ex ; }
        catch (Exception ex)
        {
            throw new CmdException("Exception", ex) ;
        }
    }
View Full Code Here

TOP

Related Classes of arq.cmd.CmdException

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.