Fixed error in FileUtils when creating a new File with append = true.
In this case FileUtils throws a FileCreationException if the path for the new file doesn't already exist, because it doesn't try to create the path. TestCase appendend to FileUtilsTests testCreateDirectoryStructureAppendMode checks that a path is creaded if append is true
This commit is contained in:
committed by
Michael Minella
parent
3ea8d3ed65
commit
7c9396da18
@@ -74,6 +74,9 @@ public final class FileUtils {
|
||||
}
|
||||
else {
|
||||
if (!file.exists()) {
|
||||
if (file.getParent() != null) {
|
||||
new File(file.getParent()).mkdirs();
|
||||
}
|
||||
if (!createNewFile(file)) {
|
||||
throw new ItemStreamException("Output file was not created: [" + file.getAbsolutePath()
|
||||
+ "]");
|
||||
|
||||
Reference in New Issue
Block a user