[jOOQ/jOOQ#9233] Use new Source API throughout the jOOQ API
This commit is contained in:
parent
118d3148fc
commit
56530816d2
@ -38,14 +38,14 @@
|
||||
package org.jooq.tools.jdbc;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.LineNumberReader;
|
||||
import java.io.Reader;
|
||||
import java.io.StringReader;
|
||||
|
||||
import org.jooq.Source;
|
||||
|
||||
/**
|
||||
* A configuration object for the {@link MockFileDatabase}.
|
||||
*
|
||||
@ -72,19 +72,23 @@ public final class MockFileDatabaseConfiguration {
|
||||
}
|
||||
|
||||
public final MockFileDatabaseConfiguration source(File file) throws IOException {
|
||||
return source(file, "UTF-8");
|
||||
return source(Source.of(file, "UTF-8"));
|
||||
}
|
||||
|
||||
public final MockFileDatabaseConfiguration source(File file, String encoding) throws IOException {
|
||||
return source(new FileInputStream(file), encoding);
|
||||
return source(Source.of(file, encoding));
|
||||
}
|
||||
|
||||
public final MockFileDatabaseConfiguration source(InputStream stream) throws IOException {
|
||||
return source(stream, "UTF-8");
|
||||
return source(Source.of(stream, "UTF-8"));
|
||||
}
|
||||
|
||||
public final MockFileDatabaseConfiguration source(InputStream stream, String encoding) throws IOException {
|
||||
return source(new InputStreamReader(stream, encoding));
|
||||
return source(Source.of(stream, encoding));
|
||||
}
|
||||
|
||||
public final MockFileDatabaseConfiguration source(Source source) {
|
||||
return source(source.reader());
|
||||
}
|
||||
|
||||
public final MockFileDatabaseConfiguration source(Reader reader) {
|
||||
@ -92,7 +96,7 @@ public final class MockFileDatabaseConfiguration {
|
||||
}
|
||||
|
||||
public final MockFileDatabaseConfiguration source(String string) {
|
||||
return source(new StringReader(string));
|
||||
return source(Source.of(string));
|
||||
}
|
||||
|
||||
public final MockFileDatabaseConfiguration patterns(boolean newPatterns) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user