From: Dominik Stadler Date: Thu, 7 Jan 2021 06:52:46 +0000 (+0000) Subject: Improve EmptyFileException when the file actually does not exist at all X-Git-Tag: REL_5_0_0~28 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ce701485d811daac24613a17d6b8e3fa241da5b2;p=poi.git Improve EmptyFileException when the file actually does not exist at all git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1885227 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/EmptyFileException.java b/src/java/org/apache/poi/EmptyFileException.java index 07828343be..5abbcd0fe6 100644 --- a/src/java/org/apache/poi/EmptyFileException.java +++ b/src/java/org/apache/poi/EmptyFileException.java @@ -29,6 +29,8 @@ public class EmptyFileException extends IllegalArgumentException { } public EmptyFileException(File file) { - super("The supplied file '" + file.getAbsolutePath() + "' was empty (zero bytes long)"); + super(file.exists() ? + "The supplied file '" + file.getAbsolutePath() + "' was empty (zero bytes long)" : + "The file '" + file.getAbsolutePath() + "' does not exist"); } } \ No newline at end of file