From c114faa659268c0dfd133b4e3f569767593bd751 Mon Sep 17 00:00:00 2001 From: James Ahlborn Date: Wed, 25 Nov 2015 02:12:45 +0000 Subject: [PATCH] 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 --- .../com/healthmarketscience/jackcess/impl/DatabaseImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) { -- 2.39.5