From: James Ahlborn Date: Mon, 17 Dec 2018 23:21:35 +0000 (+0000) Subject: merge trunk changes through r1241 X-Git-Tag: jackcess-3.0.0~7^2~20 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=84e162f6e2ccdd40f5b962fa1bb44aaab79dfa66;p=jackcess.git merge trunk changes through r1241 git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/jdk8@1242 f203690c-595d-4dc9-a70b-905162fa7fd2 --- 84e162f6e2ccdd40f5b962fa1bb44aaab79dfa66 diff --cc src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java index c5f5481,bb74bba..dcd4e18 --- a/src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java @@@ -259,9 -252,11 +259,11 @@@ public class DatabaseImpl implements Da Pattern.compile("[\\p{Cntrl}.!`\\]\\[]"); /** the File of the database */ - private final File _file; + private final Path _file; /** the simple name of the database */ private final String _name; + /** whether or not this db is read-only */ + private final boolean _readOnly; /** Buffer to hold database pages */ private ByteBuffer _buffer; /** ID of the Tables system object */ @@@ -518,9 -512,10 +522,10 @@@ * @param charset Charset to use, if {@code null}, uses default * @param timeZone TimeZone to use, if {@code null}, uses default */ - protected DatabaseImpl(File file, FileChannel channel, boolean closeChannel, + protected DatabaseImpl(Path file, FileChannel channel, boolean closeChannel, boolean autoSync, FileFormat fileFormat, Charset charset, - TimeZone timeZone, CodecProvider provider) + TimeZone timeZone, CodecProvider provider, + boolean readOnly) throws IOException { _file = file; diff --cc src/main/java/com/healthmarketscience/jackcess/util/CustomLinkResolver.java index 0463b2d,fce5289..1dc0b80 --- a/src/main/java/com/healthmarketscience/jackcess/util/CustomLinkResolver.java +++ b/src/main/java/com/healthmarketscience/jackcess/util/CustomLinkResolver.java @@@ -159,10 -161,11 +162,11 @@@ public abstract class CustomLinkResolve * @return the temp db for holding the linked table info */ protected Database createTempDb(Object customFile, FileFormat format, - boolean inMemory, Path tempDir) - boolean inMemory, File tempDir, ++ boolean inMemory, Path tempDir, + boolean readOnly) throws IOException { - File dbFile = null; + Path dbFile = null; FileChannel channel = null; boolean success = false; try { @@@ -258,11 -256,12 +262,12 @@@ private final Object _customFile; protected TempDatabaseImpl(CustomLinkResolver resolver, Object customFile, - File file, FileChannel channel, + Path file, FileChannel channel, - FileFormat fileFormat) + FileFormat fileFormat, boolean readOnly) throws IOException { - super(file, channel, true, false, fileFormat, null, null, null); + super(file, channel, true, false, fileFormat, null, null, null, + readOnly); _resolver = resolver; _customFile = customFile; } diff --cc src/test/java/com/healthmarketscience/jackcess/util/CustomLinkResolverTest.java index b2dfc06,87f8e6f..d0446b2 --- a/src/test/java/com/healthmarketscience/jackcess/util/CustomLinkResolverTest.java +++ b/src/test/java/com/healthmarketscience/jackcess/util/CustomLinkResolverTest.java @@@ -149,7 -149,8 +149,8 @@@ public class CustomLinkResolverTest ext @Override protected Database createTempDb(Object customFile, FileFormat format, - boolean inMemory, Path tempDir) - boolean inMemory, File tempDir, ++ boolean inMemory, Path tempDir, + boolean readOnly) throws IOException { inMemory = "testFile1.txt".equals(customFile);