public void cmdError(String msg, boolean exit) { System.err.println(msg) ; if ( exit ) throw new TerminationException(5) ; } }
public void cmdError(String msg, boolean exit) { System.err.println(msg) ; if ( exit ) throw new TerminationException(5) ; } }
@Override protected void exec() { try { runFuseki(cmdLineConfig, jettyServerConfig) ; } catch (FusekiException ex) { throw new TerminationException(1) ; } }
@Override protected void exec() { try { runFuseki(cmdLineConfig, jettyServerConfig) ; } catch (FusekiException ex) { throw new TerminationException(1) ; } }
final public void printHelp() { usage() ; throw new TerminationException(0) ; }
final public void printHelp() { usage() ; throw new TerminationException(0) ; }
private void execGet(StoreConfig conf, String tag) { Model m = conf.getModel(tag) ; if ( m == null ) { System.out.println("No configuration model") ; throw new TerminationException(1) ; } m.write(System.out, format) ; }
@Override public void processArgs(CmdArgModule cmdLine) { // Either a dataset or a store. if (! cmdLine.contains(argDeclSDBdesc)) { System.err.println("No store description"); throw new TerminationException(1); } filename = cmdLine.getValue(argDeclSDBdesc) ; }
private void execReset(StoreConfig conf, String name) { if ( ! confirm("Confirm reset") ) throw new TerminationException(0) ; conf.reset() ; }
private void execRemove(StoreConfig conf, String name) { if ( ! confirm("Confirm the removal of '"+name+"'") ) throw new TerminationException(0) ; conf.removeModel(name) ; }
/** Choose the dataset. * <li> use the data as described on the command line * <li> else use FROM/FROM NAMED if present (pass null to ARQ) * <li> else provided an empty dataset and hope the query has VALUES/BIND */ protected Dataset getDataset(Query query) { try { Dataset ds = modDataset.getDataset(); if ( ds == null ) ds = dealWithNoDataset(query); return ds; } catch (RiotNotFoundException ex) { System.err.println("Failed to load data: " + ex.getMessage()); throw new TerminationException(1); } catch (RiotException ex) { System.err.println("Failed to load data"); throw new TerminationException(1); } }
/** Choose the dataset. * <li> use the data as described on the command line * <li> else use FROM/FROM NAMED if present (pass null to ARQ) * <li> else provided an empty dataset and hope the query has VALUES/BIND */ protected Dataset getDataset(Query query) { try { Dataset ds = modDataset.getDataset(); if ( ds == null ) ds = dealWithNoDataset(query); return ds; } catch (RiotNotFoundException ex) { System.err.println("Failed to load data: " + ex.getMessage()); throw new TerminationException(1); } catch (RiotException ex) { System.err.println("Failed to load data"); throw new TerminationException(1); } }
try{ if (!service.awaitTermination(60, TimeUnit.SECONDS)) throw new TerminationException("Service did not terminate");
static void ensureDirExists(String dirname) { File f = new File(dirname) ; if ( ! f.exists() || !f.isDirectory() ) { System.err.println("Can't find required directory: '"+dirname+"'") ; throw new TerminationException(8) ; } } }
static void ensureDirExists(String dirname) { File f = new File(dirname) ; if ( ! f.exists() || !f.isDirectory() ) { System.err.println("Can't find required directory: '"+dirname+"'") ; throw new TerminationException(8) ; } } }
throw new TerminationException(1) ; throw new TerminationException(9) ; throw new TerminationException(9) ; throw new TerminationException(99) ;
throw new TerminationException(1) ; throw new TerminationException(9) ; throw new TerminationException(9) ; throw new TerminationException(99) ;
@Override protected void exec(Item item) { if ( ! print ) return ; if ( item == null ) { System.err.println("No expression") ; throw new TerminationException(9) ; } divider() ; IndentedWriter out = new IndentedWriter(System.out, lineNumbers) ; // Need to check if used. //PrefixMapping pmap = SSE.getDefaultPrefixMapWrite() ; PrefixMapping pmap = null ; SerializationContext sCxt = new SerializationContext(pmap) ; ItemWriter.write(out, item, sCxt) ; //item.output(out) ; out.ensureStartOfLine() ; out.flush(); } }
@Override protected void exec(Item item) { if ( ! print ) return ; if ( item == null ) { System.err.println("No expression") ; throw new TerminationException(9) ; } divider() ; IndentedWriter out = new IndentedWriter(System.out, lineNumbers) ; // Need to check if used. //PrefixMapping pmap = SSE.getDefaultPrefixMapWrite() ; PrefixMapping pmap = null ; SerializationContext sCxt = new SerializationContext(pmap) ; ItemWriter.write(out, item, sCxt) ; //item.output(out) ; out.ensureStartOfLine() ; out.flush(); } }
throw new TerminationException(9) ;