diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2015-11-25 02:12:45 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2015-11-25 02:12:45 +0000 |
commit | c114faa659268c0dfd133b4e3f569767593bd751 (patch) | |
tree | b596ad2ccc0c66714a217f7d715e4384ce728441 | |
parent | 86b2f3a9831d89091b86d292901c2b38b8dc61bb (diff) | |
download | jackcess-c114faa659268c0dfd133b4e3f569767593bd751.tar.gz jackcess-c114faa659268c0dfd133b4e3f569767593bd751.zip |
throw better exception when attempting to create file which does not support creation
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@963 f203690c-595d-4dc9-a70b-905162fa7fd2
-rw-r--r-- | src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java index 4f3c554..26a7f1b 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java @@ -426,9 +426,13 @@ public class DatabaseImpl implements Database { FileFormatDetails details = getFileFormatDetails(fileFormat); if (details.getFormat().READ_ONLY) { - throw new IOException("file format " + fileFormat + + throw new IOException("File format " + fileFormat + " does not support writing for " + mdbFile); } + if(details.getEmptyFilePath() == null) { + throw new IOException("File format " + fileFormat + + " does not support file creation for " + mdbFile); + } boolean closeChannel = false; if(channel == null) { |