@Test public final void testExportAll() throws RepositoryException, IOException { File nq = LOCATION.newFile("all.nq"); export.execute("export", nq.toString()); Model exp = Rio.parse(Files.newReader(nq, StandardCharsets.UTF_8), "http: assertTrue("File is empty", nq.length() > 0); assertEquals("Number of contexts incorrect", 3, exp.contexts().size()); nq.delete(); }
@Override public void execute(String... tokens) { Repository repository = state.getRepository(); if (repository == null) { consoleIO.writeUnopenedError(); return; } if (tokens.length < 2) { consoleIO.writeln(getHelpLong()); return; } String fileName = tokens[1]; Resource[] contexts; try { contexts = Util.getContexts(tokens, 2, repository); } catch (IllegalArgumentException ioe) { consoleIO.writeError(ioe.getMessage()); return; } export(repository, fileName, contexts); }
Export extends ConsoleCommand { @Override public void execute(String... tokens) { Repository repository = state.getRepository(); if (repository == null) { consoleIO.writeUnopenedError(); return; } if (tokens.length < 2) { consoleIO.writeln(getHelpLong()); return; } String fileName = tokens[1]; Resource[] contexts; try { contexts = Util.getContexts(tokens, 2, repository); } catch (IllegalArgumentException ioe) { consoleIO.writeError(ioe.getMessage()); return; } export(repository, fileName, contexts); } }
Export extends ConsoleCommand { @Override public void execute(String... tokens) { Repository repository = state.getRepository(); if (repository == null) { consoleIO.writeUnopenedError(); return; } if (tokens.length < 2) { consoleIO.writeln(getHelpLong()); return; } String fileName = tokens[1]; Resource[] contexts; try { contexts = Util.getContexts(tokens, 2, repository); } catch (IllegalArgumentException ioe) { consoleIO.writeError(ioe.getMessage()); return; } export(repository, fileName, contexts); } Export(ConsoleIO consoleIO, ConsoleState state); }
Export extends ConsoleCommand { @Override public void execute(String... tokens) { Repository repository = state.getRepository(); if (repository == null) { consoleIO.writeUnopenedError(); return; } if (tokens.length < 2) { consoleIO.writeln(getHelpLong()); return; } String fileName = tokens[1]; Resource[] contexts; try { contexts = Util.getContexts(tokens, 2, repository); } catch (IllegalArgumentException ioe) { consoleIO.writeError(ioe.getMessage()); return; } export(repository, fileName, contexts); } Export(ConsoleIO consoleIO, ConsoleState state); @Override String getName(); @Override String getHelpShort(); @Override String getHelpLong(); @Override void execute(String... tokens); }
Export extends ConsoleCommand { @Override public void execute(String... tokens) { Repository repository = state.getRepository(); if (repository == null) { consoleIO.writeUnopenedError(); return; } if (tokens.length < 2) { consoleIO.writeln(getHelpLong()); return; } String fileName = tokens[1]; Resource[] contexts; try { contexts = Util.getContexts(tokens, 2, repository); } catch (IllegalArgumentException ioe) { consoleIO.writeError(ioe.getMessage()); return; } export(repository, fileName, contexts); } Export(ConsoleIO consoleIO, ConsoleState state); @Override String getName(); @Override String getHelpShort(); @Override String getHelpLong(); @Override void execute(String... tokens);  }