]> source.dussan.org Git - poi.git/commitdiff
Improve EmptyFileException when the file actually does not exist at all
authorDominik Stadler <centic@apache.org>
Thu, 7 Jan 2021 06:52:46 +0000 (06:52 +0000)
committerDominik Stadler <centic@apache.org>
Thu, 7 Jan 2021 06:52:46 +0000 (06:52 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1885227 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/EmptyFileException.java

index 07828343be29caf7d821c19b45c812186fa038cf..5abbcd0fe60c472f0ee9ede298b4449610d8ad4f 100644 (file)
@@ -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