diff --git a/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java b/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java index 510c16b87..a2953c5bc 100644 --- a/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java +++ b/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java @@ -440,8 +440,15 @@ private int processFile(Report report) { if (expanded) { - Archive epub; + // check existance of path (fix #525) + File f = new File(path); + if (!f.exists()) + { + System.err.println(String.format(Messages.get("directory_not_found"), path)); + return 1; + } + Archive epub; try { epub = new Archive(path, true); diff --git a/src/main/resources/com/adobe/epubcheck/util/messages.properties b/src/main/resources/com/adobe/epubcheck/util/messages.properties index 2cb2f4244..4424d4eed 100644 --- a/src/main/resources/com/adobe/epubcheck/util/messages.properties +++ b/src/main/resources/com/adobe/epubcheck/util/messages.properties @@ -21,6 +21,7 @@ validating_version_message=Validating using EPUB version %1$s rules. output_type_conflict=Only one output format can be specified at a time. validating_against_epub_version=Validating against EPUB version %1$s - custom validation file_not_found=File not found: '%1$s' +directory_not_found=Directory not found: '%1$s' epubcheck_completed=epubcheck completed error_creating_config_file=Error creating config file '%1$s'. expected_message_filename=Expected the Custom message file name, but found '%1$s'