]> source.dussan.org Git - poi.git/commitdiff
on Windows, a directory cannot contain a file and a directory with the same name
authorJaven O'Neal <onealj@apache.org>
Wed, 19 Oct 2016 05:18:48 +0000 (05:18 +0000)
committerJaven O'Neal <onealj@apache.org>
Wed, 19 Oct 2016 05:18:48 +0000 (05:18 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1765531 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/poifs/dev/POIFSDump.java

index 9d53d2185cd43c95195e086d237896862a1f7f11..ad3e6176ee68b6a05b8ad66361e40f375f9040bc 100644 (file)
@@ -71,7 +71,9 @@ public class POIFSDump {
             }
             try {
                 DirectoryEntry root = fs.getRoot();
-                File file = new File(new File(filename).getName(), root.getName());
+                String filenameWithoutPath = new File(filename).getName();
+                File dumpDir = new File(filenameWithoutPath + "_dump");
+                File file = new File(dumpDir, root.getName());
                 if (!file.exists() && !file.mkdirs()) {
                     throw new IOException("Could not create directory " + file);
                 }