From: Son Hyunjun Date: Sat, 17 Mar 2012 19:07:25 +0000 (+0900) Subject: [Title] create skin log file path if not exists X-Git-Tag: TizenStudio_2.0_p2.3~1651 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27d5bd9417c6b1a36336b56d8eb096aacf3a8b33;p=sdk%2Femulator%2Fqemu.git [Title] create skin log file path if not exists [Type] Bugfix [Module] [Priority] Minor [CQ#] [Redmine#] [Problem] [Cause] [Solution] Change-Id: I9b97400a5b40d3c6af508b4775f040604c3db4e4 --- diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/log/SkinLogger.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/log/SkinLogger.java index 8e345c9..a02683b 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/log/SkinLogger.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/log/SkinLogger.java @@ -95,13 +95,30 @@ public class SkinLogger { String path = ""; if( !StringUtil.isEmpty( filePath ) ) { - path = filePath; + path = filePath + File.separator; } + + File dir = new File( path + LOG_FOLDER ); + dir.mkdir(); + File file = new File( dir + File.separator + FILE_NAME ); + if( !file.exists() ) { + try { + if( !file.createNewFile() ) { + System.err.println( "[SkinLog:error]Cannot create skin log file. path:" + file.getAbsolutePath() ); + System.exit( -1 ); + return; + } + } catch ( IOException e ) { + e.printStackTrace(); + System.exit( -1 ); + return; + } + } + try { - path = path + File.separator + LOG_FOLDER + File.separator + FILE_NAME; - System.out.println( "[SkinLog]log file path:" + path ); - fileHandler = new FileHandler( path, false ); + System.out.println( "[SkinLog]log file path:" + file.getAbsolutePath() ); + fileHandler = new FileHandler( file.getAbsolutePath(), false ); } catch ( SecurityException e1 ) { e1.printStackTrace(); } catch ( IOException e1 ) {