Details
Description
----Original Message----
From: deng xinzi xinzi6388@gmail.com
Sent: Sunday, February 04, 2007 6:19 AM
To: commons-dev@jakarta.apache.org
Subject: [bug]commons-io 1.3 FileUtils.openOutputStream(File file) NullPointException
FileUtils.openOutputStream(File file)
When the file = new File( "abc.txt" );
There will be a NullPointerException throw.
Cause
file = new File("abc.txt")
file.getParentFile() returns null.
So I suggest adding the null check code like this.
File parent = file.getParentFile();
if( parent Unable to render embedded object: File (= null ) { // ADD THIS) not found.!!
if (parent.exists() == false) {
if (parent.mkdirs() == false)
}
}
Xinzi ...