on Windows, a directory cannot contain a file and a directory with the same name

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1765531 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Javen O'Neal 2016-10-19 05:18:48 +00:00
parent 5fed0edcae
commit 3f635e5be5
1 changed files with 3 additions and 1 deletions

View 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);
}