@Override public InputStream newInputStream() throws IOException { return base.newInputStream(); }
/** * Create an input stream to read from the file. * This method is similar to Java 7 * <code>java.nio.file.Path.newInputStream</code>. * * @param fileName the file name * @return the input stream */ public static InputStream newInputStream(String fileName) throws IOException { return FilePath.get(fileName).newInputStream(); }
@Override public InputStream newInputStream() throws IOException { InputStream input = getBase().newInputStream(); for (int i = 1;; i++) { FilePath f = getBase(i); if (f.exists()) { InputStream i2 = f.newInputStream(); input = new SequenceInputStream(input, i2); } else { break; } } return input; }
@Override public InputStream newInputStream() throws IOException { return base.newInputStream(); }
@Override public InputStream newInputStream() throws IOException { return base.newInputStream(); }
/** * Create an input stream to read from the file. * This method is similar to Java 7 * <code>java.nio.file.Path.newInputStream</code>. * * @param fileName the file name * @return the input stream */ public static InputStream newInputStream(String fileName) throws IOException { return FilePath.get(fileName).newInputStream(); }
/** * Create an input stream to read from the file. * This method is similar to Java 7 * <code>java.nio.file.Path.newInputStream</code>. * * @param fileName the file name * @return the input stream */ public static InputStream newInputStream(String fileName) throws IOException { return FilePath.get(fileName).newInputStream(); }
@Override public InputStream newInputStream() throws IOException { InputStream input = getBase().newInputStream(); for (int i = 1;; i++) { FilePath f = getBase(i); if (f.exists()) { InputStream i2 = f.newInputStream(); input = new SequenceInputStream(input, i2); } else { break; } } return input; }
@Override public InputStream newInputStream() throws IOException { InputStream input = getBase().newInputStream(); for (int i = 1;; i++) { FilePath f = getBase(i); if (f.exists()) { InputStream i2 = f.newInputStream(); input = new SequenceInputStream(input, i2); } else { break; } } return input; }
@Override public void connectionMade(final String name, final Connection connection) { final FilePath filePath = FilePath.get(resource); try (final InputStream inputStream = filePath.newInputStream(); final Statement statement = connection.createStatement(); final ByteArrayOutputStream out = new ByteArrayOutputStream(Math.max(32, inputStream.available())); ) { copyToOutputStream(inputStream, out); statement.execute(convertToString(out.toByteArray())); } catch (IOException e) { throw new IllegalArgumentException(String.format("Could not read SQL from file path \"%s\"", filePath.getName()), e); } catch (SQLException e) { throw new IllegalArgumentException(String.format("Could not run SQL script from file path \"%s\"", filePath.getName()), e); } }
@Override public void connectionMade(final String name, final Connection connection) { final FilePath filePath = FilePath.get(resource); try (final InputStream inputStream = filePath.newInputStream(); final Statement statement = connection.createStatement(); final ByteArrayOutputStream out = new ByteArrayOutputStream(Math.max(32, inputStream.available())); ) { copyToOutputStream(inputStream, out); statement.execute(convertToString(out.toByteArray())); } catch (IOException e) { throw new IllegalArgumentException(String.format("Could not read SQL from file path \"%s\"", filePath.getName()), e); } catch (SQLException e) { throw new IllegalArgumentException(String.format("Could not run SQL script from file path \"%s\"", filePath.getName()), e); } }