[Jiemamy-notify:2404] commit [3404] [CORE-128] SqlExporterにて、出力先のディレクトリがなければ掘る処理を追加。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 5月 18日 (月) 20:57:19 JST


Revision: 3404
          http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=3404
Author:   daisuke_m
Date:     2009-05-18 20:57:19 +0900 (Mon, 18 May 2009)

Log Message:
-----------
[CORE-128] SqlExporterにて、出力先のディレクトリがなければ掘る処理を追加。

Modified Paths:
--------------
    artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/composer/exporter/SqlExporter.java


-------------- next part --------------
Modified: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/composer/exporter/SqlExporter.java
===================================================================
--- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/composer/exporter/SqlExporter.java	2009-05-18 08:18:02 UTC (rev 3403)
+++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/composer/exporter/SqlExporter.java	2009-05-18 11:57:19 UTC (rev 3404)
@@ -82,6 +82,14 @@
 				}
 			}
 			
+			File parentDir = outputFile.getParentFile();
+			if (parentDir.exists() == false) {
+				boolean mkdirResult = parentDir.mkdir();
+				if (mkdirResult == false) {
+					throw new ExportException("Cannot create directory: " + parentDir.getAbsolutePath());
+				}
+			}
+			
 			writer = new OutputStreamWriter(new FileOutputStream(outputFile), CharEncoding.UTF_8);
 			for (SqlStatement stmt : statements) {
 				writer.write(stmt.toString());



Jiemamy-notify メーリングリストの案内
Back to archive index