@Override protected DatasetGraph dealWithNoDataset() { throw new CmdException("No dataset provided"); } }
@Override protected DatasetGraph dealWithNoDataset() { throw new CmdException("No dataset provided") ; } }
/** * Handle an unrecognised argument; default is to throw an exception * @param argStr The string image of the unrecognised argument */ protected void handleUnrecognizedArg( String argStr ) { throw new CmdException("Unknown argument: "+argStr) ; }
@Override protected DatasetGraph dealWithNoDataset() { throw new CmdException("No dataset provided") ; } }
protected static String subCommand(String ... argv) { if ( argv.length == 0 ) throw new CmdException("Missing subcommand") ; String subCmd = argv[0] ; if ( subCmd.startsWith("-") ) throw new CmdException("Argument found where subcommand expected") ; return subCmd ; }
protected static String subCommand(String... argv) { if ( argv.length == 0 ) throw new CmdException("Missing subcommand") ; String subCmd = argv[0] ; if ( subCmd.startsWith("-") ) throw new CmdException("Argument found where subcommand expected") ; return subCmd ; }
@Override protected void processModulesAndArgs() { if ( getNumPositional() > 0 ) throw new CmdException("No position arguments (specify DB in spec file or with --dbName DB") ; if ( ! super.contains(argDeclConfirm) ) throw new CmdException("Argument --confirm required") ; }
protected void exec() { Exec exec = dispatch.get(subCmd) ; if ( exec == null ) throw new CmdException("No subcommand: "+subCmd) ; exec.exec(args) ; }
public String indirect(String s, String marker) { if ( !matchesIndirect(s, marker) ) return s ; s = s.substring(marker.length()) ; try { return new String(readAllBytes(Paths.get(s))); } catch (IOException e) { throw new CmdException("Could not read from: " + s, e); } }
protected void exec() { Exec exec = dispatch.get(subCmd) ; if ( exec == null ) throw new CmdException("No subcommand: " + subCmd) ; exec.exec(args) ; }
@Override protected void processModulesAndArgs() { if ( getNumPositional() > 0 ) throw new CmdException("No position arguments (specify DB in spec file or with --dbName DB") ; }
private int portNumber(ArgDecl arg) { String portStr = getValue(arg); try { int port = Integer.parseInt(portStr); return port; } catch (NumberFormatException ex) { throw new CmdException(argPort.getKeyName() + " : bad port number: " + portStr); } }
@Override protected void processModulesAndArgs() { super.processModulesAndArgs() ; if ( modRemote.getServiceURL() == null ) throw new CmdException("No SPARQL endpoint specificied") ; }
protected Model getModel() { Dataset ds = tdbDatasetAssembler.getDataset(); if ( graphName != null ) { Model m = ds.getNamedModel(graphName); if ( m == null ) throw new CmdException("No such named graph (is this a TDB dataset?)"); return m; } else return ds.getDefaultModel(); }
protected Model getModel() { Dataset ds = getDataset(); if ( graphName != null ) { Model m = ds.getNamedModel(graphName); if ( m == null ) throw new CmdException("No such named graph (is this a TDB dataset?)"); return m; } else return ds.getDefaultModel(); }
private void execPut(StoreConfig conf, String tag, List<String> positionalArgs) { if ( positionalArgs.size() == 0 ) throw new CmdException("No file to load") ; Model model = conf.getModel(tag) ; if ( model == null ) model = ModelFactory.createDefaultModel() ; for ( String filename : positionalArgs) FileManager.get().readModel(model, filename) ; conf.setModel(tag, model) ; }
@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() ; }
@Override protected void processModulesAndArgs() { if ( ! contains(argRDFS) ) throw new CmdException("Required argument missing: --"+argRDFS.getKeyName()) ; String fn = getValue(argRDFS) ; vocab = FileManager.get().loadModel(fn) ; }
@Override protected void processModulesAndArgs() { if ( ! hasPositional() ) throw new CmdException("No manifest file") ; createEarlReport = contains(earlDecl) ; }
@Override protected void exec() { if ( modLangParse.skipOnBadTerm() ) throw new CmdException("Not supported : skip on bad term"); boolean oldStrictValue = SysRIOT.isStrictMode() ; if ( modLangParse.strictMode() ) SysRIOT.setStrictMode(true) ; try { exec$() ; } finally { SysRIOT.setStrictMode(oldStrictValue) ; } }