@Override public String get() { final String output; try { if (!isFileReadable(file)) { output = ""; } else { output = new String(readAllBytes(file), charset); } } catch (final IOException e) { return ""; } return output; }
@Override public String get() { final String output; try { if (!isFileReadable(file)) { output = ""; } else { output = new String(readAllBytes(file), charset); } } catch (final IOException e) { return ""; } return output; }
private FileInputResource(final Path filePath, final boolean allowEmptyFile) throws IOException { inputFile = requireNonNull(filePath, "No file path provided").normalize() .toAbsolutePath(); if (!isFileReadable(inputFile)) { final IOException e = new IOException("Cannot read file, " + inputFile); LOGGER.log(Level.FINE, e.getMessage(), e); throw e; } }
protected final Path checkDatabaseFile(final Path dbFile) throws IOException { final Path databaseFile = requireNonNull(dbFile, "No database file path provided") .normalize().toAbsolutePath(); if (!isFileReadable(databaseFile)) { final IOException e = new IOException("Cannot read database file, " + databaseFile); LOGGER.log(Level.FINE, e.getMessage(), e); throw e; } return databaseFile; }
protected AbstractGraphProcessExecutor(final Path dotFile, final Path outputFile, final GraphOutputFormat graphOutputFormat) throws SchemaCrawlerException { requireNonNull(dotFile, "No DOT file provided"); requireNonNull(outputFile, "No graph output file provided"); requireNonNull(graphOutputFormat, "No graph output format provided"); this.dotFile = dotFile.normalize().toAbsolutePath(); this.outputFile = outputFile.normalize().toAbsolutePath(); this.graphOutputFormat = graphOutputFormat; if (!isFileReadable(this.dotFile)) { throw new SchemaCrawlerException("Cannot read DOT file, " + this.dotFile); } if (!isFileWritable(this.outputFile)) { throw new SchemaCrawlerException("Cannot write output file, " + this.outputFile); } }
private Path getDatabaseDumpFile(final Config config) { final String database = config.get("database"); final Path databaseFile; if (!isBlank(database)) { if (isFileReadable(Paths.get(database))) { databaseFile = Paths.get(database); } else { databaseFile = null; } } else { databaseFile = null; } return databaseFile; }
requireNonNull(outputFormat, "Output format is not defined"); if (!isFileReadable(testOutputTempFile))
@Override public String get() { final String output; try { if (!isFileReadable(file)) { output = ""; } else { output = new String(readAllBytes(file), charset); } } catch (final IOException e) { return ""; } return output; }
@Override public String get() { final String output; try { if (!isFileReadable(file)) { output = ""; } else { output = new String(readAllBytes(file), charset); } } catch (final IOException e) { return ""; } return output; }
private FileInputResource(final Path filePath, final boolean allowEmptyFile) throws IOException { inputFile = requireNonNull(filePath, "No file path provided").normalize() .toAbsolutePath(); if (!isFileReadable(inputFile)) { final IOException e = new IOException("Cannot read file, " + inputFile); LOGGER.log(Level.FINE, e.getMessage(), e); throw e; } }
private FileInputResource(final Path filePath, final boolean allowEmptyFile) throws IOException { inputFile = requireNonNull(filePath, "No file path provided").normalize() .toAbsolutePath(); if (!isFileReadable(inputFile)) { final IOException e = new IOException("Cannot read file, " + inputFile); LOGGER.log(Level.FINE, e.getMessage(), e); throw e; } }
protected final Path checkDatabaseFile(final Path dbFile) throws IOException { final Path databaseFile = requireNonNull(dbFile, "No database file path provided") .normalize().toAbsolutePath(); if (!isFileReadable(databaseFile)) { final IOException e = new IOException("Cannot read database file, " + databaseFile); LOGGER.log(Level.FINE, e.getMessage(), e); throw e; } return databaseFile; }
protected final Path checkDatabaseFile(final Path dbFile) throws IOException { final Path databaseFile = requireNonNull(dbFile, "No database file path provided") .normalize().toAbsolutePath(); if (!isFileReadable(databaseFile)) { final IOException e = new IOException("Cannot read database file, " + databaseFile); LOGGER.log(Level.FINE, e.getMessage(), e); throw e; } return databaseFile; }
protected AbstractGraphProcessExecutor(final Path dotFile, final Path outputFile, final GraphOutputFormat graphOutputFormat) throws SchemaCrawlerException { requireNonNull(dotFile, "No DOT file provided"); requireNonNull(outputFile, "No graph output file provided"); requireNonNull(graphOutputFormat, "No graph output format provided"); this.dotFile = dotFile.normalize().toAbsolutePath(); this.outputFile = outputFile.normalize().toAbsolutePath(); this.graphOutputFormat = graphOutputFormat; if (!isFileReadable(this.dotFile)) { throw new SchemaCrawlerException("Cannot read DOT file, " + this.dotFile); } if (!isFileWritable(this.outputFile)) { throw new SchemaCrawlerException("Cannot write output file, " + this.outputFile); } }
protected AbstractGraphProcessExecutor(final Path dotFile, final Path outputFile, final GraphOutputFormat graphOutputFormat) throws SchemaCrawlerException { requireNonNull(dotFile, "No DOT file provided"); requireNonNull(outputFile, "No graph output file provided"); requireNonNull(graphOutputFormat, "No graph output format provided"); this.dotFile = dotFile.normalize().toAbsolutePath(); this.outputFile = outputFile.normalize().toAbsolutePath(); this.graphOutputFormat = graphOutputFormat; if (!isFileReadable(this.dotFile)) { throw new SchemaCrawlerException("Cannot read DOT file, " + this.dotFile); } if (!isFileWritable(this.outputFile)) { throw new SchemaCrawlerException("Cannot write output file, " + this.outputFile); } }