private static String htmlHeader() { final StringBuilder styleSheet = new StringBuilder(4096); styleSheet.append(System.lineSeparator()) .append(readResourceFully("/sc.css")).append(System.lineSeparator()) .append(readResourceFully("/sc_output.css")) .append(System.lineSeparator()); final String htmlHeaderTemplate = readResourceFully("/html.header.txt"); final String htmlHeader = String.format(htmlHeaderTemplate, styleSheet); return htmlHeader; }
private void showCommandline(final Path outputFile, final List<String> command) { if (!LOGGER.isLoggable(Level.SEVERE)) { return; } // Find name of DOT file in local directory final Path movedDotFile = outputFile.normalize().getParent() .resolve(outputFile.getFileName() + ".dot"); // Print command to run command.remove(command.size() - 1); command.remove(command.size() - 1); command.add(outputFile.toString()); command.add(movedDotFile.toString()); LOGGER.log(Level.SEVERE, String.format("%s%nGenerate your diagram manually, using:%n%s", readResourceFully("/dot.error.txt"), String.join(" ", command))); }
private String makeGraphvizHeader() { final Map<String, String> graphvizAttributes = options .getGraphvizAttributes(); final String graphvizHeaderTemplate = readResourceFully("/dot.header.txt"); final String graphvizHeader = String .format(graphvizHeaderTemplate, makeGraphvizAttributes(graphvizAttributes, "graph"), makeGraphvizAttributes(graphvizAttributes, "node"), makeGraphvizAttributes(graphvizAttributes, "edge")); return graphvizHeader; }
final String sql = readResourceFully(resource); if (!isBlank(sql))
final String sql = readResourceFully(resource); if (!isBlank(sql))
public static void executeScriptFromResource(final Connection connection, final String scriptResource) { try (final Statement statement = createStatement(connection);) { final String sqlScript = readResourceFully(scriptResource); if (!isBlank(sqlScript)) { for (final String sql: sqlScript.split(";")) { if (isBlank(sql)) { continue; } final ResultSet resultSet = executeSql(statement, sql, false); if (resultSet != null) { LOGGER .log(Level.WARNING, new StringFormat("Ignoring results from query <%s>", sql)); resultSet.close(); } } } } catch (final SQLException e) { LOGGER.log(Level.WARNING, e.getMessage(), e); } }
public static void executeScriptFromResource(final Connection connection, final String scriptResource) { try (final Statement statement = createStatement(connection);) { final String sqlScript = readResourceFully(scriptResource); if (!isBlank(sqlScript)) { for (final String sql: sqlScript.split(";")) { if (isBlank(sql)) { continue; } final ResultSet resultSet = executeSql(statement, sql, false); if (resultSet != null) { LOGGER .log(Level.WARNING, new StringFormat("Ignoring results from query <%s>", sql)); resultSet.close(); } } } } catch (final SQLException e) { LOGGER.log(Level.WARNING, e.getMessage(), e); } }
final String message = readResourceFully("/dot.error.txt"); throw new SchemaCrawlerCommandLineException(message);
private static String htmlHeader() { final StringBuilder styleSheet = new StringBuilder(4096); styleSheet.append(System.lineSeparator()) .append(readResourceFully("/sc.css")).append(System.lineSeparator()) .append(readResourceFully("/sc_output.css")) .append(System.lineSeparator()); final String htmlHeaderTemplate = readResourceFully("/html.header.txt"); final String htmlHeader = String.format(htmlHeaderTemplate, styleSheet); return htmlHeader; }
private static String htmlHeader() { final StringBuilder styleSheet = new StringBuilder(4096); styleSheet.append(System.lineSeparator()) .append(readResourceFully("/sc.css")).append(System.lineSeparator()) .append(readResourceFully("/sc_output.css")) .append(System.lineSeparator()); final String htmlHeaderTemplate = readResourceFully("/html.header.txt"); final String htmlHeader = String.format(htmlHeaderTemplate, styleSheet); return htmlHeader; }
private void showCommandline(final Path outputFile, final List<String> command) { if (!LOGGER.isLoggable(Level.SEVERE)) { return; } // Find name of DOT file in local directory final Path movedDotFile = outputFile.normalize().getParent() .resolve(outputFile.getFileName() + ".dot"); // Print command to run command.remove(command.size() - 1); command.remove(command.size() - 1); command.add(outputFile.toString()); command.add(movedDotFile.toString()); LOGGER.log(Level.SEVERE, String.format("%s%nGenerate your diagram manually, using:%n%s", readResourceFully("/dot.error.txt"), String.join(" ", command))); }
private void showCommandline(final Path outputFile, final List<String> command) { if (!LOGGER.isLoggable(Level.SEVERE)) { return; } // Find name of DOT file in local directory final Path movedDotFile = outputFile.normalize().getParent() .resolve(outputFile.getFileName() + ".dot"); // Print command to run command.remove(command.size() - 1); command.remove(command.size() - 1); command.add(outputFile.toString()); command.add(movedDotFile.toString()); LOGGER.log(Level.SEVERE, String.format("%s%nGenerate your diagram manually, using:%n%s", readResourceFully("/dot.error.txt"), String.join(" ", command))); }
private String makeGraphvizHeader() { final Map<String, String> graphvizAttributes = options .getGraphvizAttributes(); final String graphvizHeaderTemplate = readResourceFully("/dot.header.txt"); final String graphvizHeader = String .format(graphvizHeaderTemplate, makeGraphvizAttributes(graphvizAttributes, "graph"), makeGraphvizAttributes(graphvizAttributes, "node"), makeGraphvizAttributes(graphvizAttributes, "edge")); return graphvizHeader; }
private String makeGraphvizHeader() { final Map<String, String> graphvizAttributes = options .getGraphvizAttributes(); final String graphvizHeaderTemplate = readResourceFully("/dot.header.txt"); final String graphvizHeader = String .format(graphvizHeaderTemplate, makeGraphvizAttributes(graphvizAttributes, "graph"), makeGraphvizAttributes(graphvizAttributes, "node"), makeGraphvizAttributes(graphvizAttributes, "edge")); return graphvizHeader; }
public static void executeScriptFromResource(final Connection connection, final String scriptResource) { try (final Statement statement = createStatement(connection);) { final String sqlScript = readResourceFully(scriptResource); if (!isBlank(sqlScript)) { for (final String sql: sqlScript.split(";")) { if (isBlank(sql)) { continue; } final ResultSet resultSet = executeSql(statement, sql, false); if (resultSet != null) { LOGGER .log(Level.WARNING, new StringFormat("Ignoring results from query <%s>", sql)); resultSet.close(); } } } } catch (final SQLException e) { LOGGER.log(Level.WARNING, e.getMessage(), e); } }
final String sql = readResourceFully(resource); if (!isBlank(sql))
final String sql = readResourceFully(resource); if (!isBlank(sql))
public static void executeScriptFromResource(final Connection connection, final String scriptResource) { try (final Statement statement = createStatement(connection);) { final String sqlScript = readResourceFully(scriptResource); if (!isBlank(sqlScript)) { for (final String sql: sqlScript.split(";")) { if (isBlank(sql)) { continue; } final ResultSet resultSet = executeSql(statement, sql, false); if (resultSet != null) { LOGGER .log(Level.WARNING, new StringFormat("Ignoring results from query <%s>", sql)); resultSet.close(); } } } } catch (final SQLException e) { LOGGER.log(Level.WARNING, e.getMessage(), e); } }
final String message = readResourceFully("/dot.error.txt"); throw new SchemaCrawlerCommandLineException(message);
final String message = readResourceFully("/dot.error.txt"); throw new SchemaCrawlerCommandLineException(message);