diff options
author | Dan Rollo <bhamail@users.sf.net> | 2010-03-11 22:57:26 +0000 |
---|---|---|
committer | Dan Rollo <bhamail@users.sf.net> | 2010-03-11 22:57:26 +0000 |
commit | 8e306bc27b795188c11be761f5371dc2478f4350 (patch) | |
tree | 90b4484cee0431d5ad7d139cf1edd10691985ba0 /src/java/com/healthmarketscience/jackcess/Database.java | |
parent | 5186af380ec14b27a4cafa62d95025363a5b9a2e (diff) | |
download | jackcess-8e306bc27b795188c11be761f5371dc2478f4350.tar.gz jackcess-8e306bc27b795188c11be761f5371dc2478f4350.zip |
apply changes from patch: 2964626 - support for Jet3 and Jet5 formats.
still need to update tests/data to test against new formats.
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/newformats@439 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/java/com/healthmarketscience/jackcess/Database.java')
-rw-r--r-- | src/java/com/healthmarketscience/jackcess/Database.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/java/com/healthmarketscience/jackcess/Database.java b/src/java/com/healthmarketscience/jackcess/Database.java index 8609b65..e31cc7d 100644 --- a/src/java/com/healthmarketscience/jackcess/Database.java +++ b/src/java/com/healthmarketscience/jackcess/Database.java @@ -370,11 +370,24 @@ public class Database EMPTY_MDB)), 0, Integer.MAX_VALUE); return new Database(channel, autoSync); } - - private static FileChannel openChannel(File mdbFile, boolean readOnly) + + /** + * Package visible only to support unit tests via DatabaseTest.openChannel(). + * @param mdbFile file to open + * @param readOnly true if read-only + * @return a FileChannel on the given file. + * @exception FileNotFoundException + * if the mode is <tt>"r"</tt> but the given file object does + * not denote an existing regular file, or if the mode begins + * with <tt>"rw"</tt> but the given file object does not denote + * an existing, writable regular file and a new regular file of + * that name cannot be created, or if some other error occurs + * while opening or creating the file + */ + static FileChannel openChannel(final File mdbFile, final boolean readOnly) throws FileNotFoundException { - String mode = (readOnly ? "r" : "rw"); + final String mode = (readOnly ? "r" : "rw"); return new RandomAccessFile(mdbFile, mode).getChannel(); } |