]> source.dussan.org Git - jackcess.git/commitdiff
throw better exception when attempting to create file which does not support creation
authorJames Ahlborn <jtahlborn@yahoo.com>
Wed, 25 Nov 2015 02:12:45 +0000 (02:12 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Wed, 25 Nov 2015 02:12:45 +0000 (02:12 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@963 f203690c-595d-4dc9-a70b-905162fa7fd2

src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java

index 4f3c554aae13563d8c6aa0cda20ebdaf0dd9798b..26a7f1b2e2acd6b199cac21ab4b26ed3703aba3a 100644 (file)
@@ -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) {