]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/SaveFile.java
1. Enhance Source Files selection in msa:
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / common / SaveFile.java
index 5d5ab9fd2b700af8c7e025b6d0d358261c59648f..e28252239fd4a001c7bcc498706252139ba0c2b9 100644 (file)
@@ -36,8 +36,13 @@ public class SaveFile {
      \r
      **/\r
     public static void main(String[] args) {\r
-        // TODO Auto-generated method stub\r
-\r
+        \r
+    }\r
+    \r
+    private static void createDirectory(String path) throws Exception {\r
+        File f = new File(path);\r
+        path = f.getParent();\r
+        FileOperation.newFolder(path);\r
     }\r
 \r
     /**\r
@@ -45,6 +50,11 @@ public class SaveFile {
      \r
      **/\r
     public static void saveMsaFile(String path, ModuleSurfaceArea msa) throws Exception {\r
+        //\r
+        // Create the file's directory first\r
+        //\r
+        createDirectory(path);\r
+        \r
         //\r
         // Remove all empty top level elements\r
         //\r
@@ -225,6 +235,11 @@ public class SaveFile {
      \r
      **/\r
     public static void saveSpdFile(String path, PackageSurfaceArea spd) throws Exception {\r
+        //\r
+        // Create the file's directory first\r
+        //\r
+        createDirectory(path);\r
+        \r
         PackageSurfaceAreaDocument spdDoc = PackageSurfaceAreaDocument.Factory.newInstance();\r
         File f = new File(path);\r
 \r
@@ -254,6 +269,11 @@ public class SaveFile {
      \r
      **/\r
     public static void saveFpdFile(String path, PlatformSurfaceArea fpd) throws Exception {\r
+        //\r
+        // Create the file's directory first\r
+        //\r
+        createDirectory(path);\r
+        \r
         PlatformSurfaceAreaDocument fpdDoc = PlatformSurfaceAreaDocument.Factory.newInstance();\r
         File f = new File(path);\r
 \r