Subversion Repository Public Repository

litesoft

Diff Revisions 71 vs 72 for /trunk/Java/core/Server/src/org/litesoft/util/FileUtil.java

Diff revisions: vs.
  @@ -15,9 +15,10 @@
15 15 throws IOException
16 16 {
17 17 Utils.assertNotNull( "File", pFile );
18 - if ( !pFile.getParentFile().mkdirs() )
18 + File zParentFile = pFile.getParentFile();
19 + if ( zParentFile != null )
19 20 {
20 - throw new FileNotFoundException( "Unable to create DIRS for: " + pFile.getAbsolutePath() );
21 + DirectoryUtils.insureDirectory( zParentFile );
21 22 }
22 23 return new BufferedWriter( new OutputStreamWriter( new FileOutputStream( pFile, pAppend ), UTF_8 ) );
23 24 }