RFR: 6244047: impossible to specify directories to logging FileHandler unless they exist
jason_mehrens at hotmail.com
Fri Nov 9 22:41:22 UTC 2012
You might just want to change the code to create and close a FileOutputStream in a way that doesn't truncate or damage the target file. Or maybe use the NIO file code if that is possible. See BUG ID 4420020.
> Date: Fri, 9 Nov 2012 16:37:02 -0500
> From: jim.gish at oracle.com
> To: core-libs-dev at openjdk.java.net
> Subject: RFR: 6244047: impossible to specify directories to logging FileHandler unless they exist
> Please review
> This updates the logging FileHandler to actually check the directory
> passed to it via the pattern to ensure that it exists and is writable.
> It does this before going into the loop to create lock files there which
> will fail repeatedly if the directory specified is invalid. If the file
> specified does not exist, or is not a directory or not writable, an
> IOException with a precise message is thrown.
> Note that this fix does not do as some users would like, which is to go
> ahead and create directories that don't exist.
> Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304
> Oracle Java Platform Group | Core Libraries Team
> 35 Network Drive
> Burlington, MA 01803
> jim.gish at oracle.com
More information about the core-libs-dev