test/jdk/tools/jpackage/helpers/JPackageHelper.java
branchJDK-8200758-branch
changeset 57314 23da9e6f446f
parent 57241 e11f3bf34083
child 57324 c1d3935fbb79
equal deleted inserted replaced
57307:4948a1944cf9 57314:23da9e6f446f
   151         }
   151         }
   152 
   152 
   153         return command;
   153         return command;
   154     }
   154     }
   155 
   155 
   156     private static void deleteRecursive(File path) throws IOException {
   156     public static void deleteRecursive(File path) throws IOException {
   157         if (!path.exists()) {
   157         if (!path.exists()) {
   158             return;
   158             return;
   159         }
   159         }
   160 
   160 
   161         Path directory = path.toPath();
   161         Path directory = path.toPath();
   189     }
   189     }
   190 
   190 
   191     public static void deleteOutputFolder(String output) throws IOException {
   191     public static void deleteOutputFolder(String output) throws IOException {
   192         File outputFolder = new File(output);
   192         File outputFolder = new File(output);
   193         System.out.println("AMDEBUG output: " + outputFolder.getAbsolutePath());
   193         System.out.println("AMDEBUG output: " + outputFolder.getAbsolutePath());
   194         deleteRecursive(outputFolder);
   194         try {
       
   195             deleteRecursive(outputFolder);
       
   196         } catch (IOException ioe) {
       
   197             System.out.println("IOException: " + ioe);
       
   198             ioe.printStackTrace();
       
   199             deleteRecursive(outputFolder);
       
   200         }
   195     }
   201     }
   196 
   202 
   197     public static String executeCLI(boolean retValZero, String... args) throws Exception {
   203     public static String executeCLI(boolean retValZero, String... args) throws Exception {
   198         int retVal;
   204         int retVal;
   199         File outfile = new File("output.log");
   205         File outfile = new File("output.log");
   342 
   348 
   343     public static void createHelloModule() throws Exception {
   349     public static void createHelloModule() throws Exception {
   344         createModule("Hello.java");
   350         createModule("Hello.java");
   345     }
   351     }
   346 
   352 
   347     private static void createModule(String javaFile) throws Exception {
   353     private static void createModule(String javaFile)
       
   354             throws Exception {
   348         int retVal;
   355         int retVal;
   349 
   356 
   350         File input = new File("input");
   357         File input = new File("input");
   351         if (!input.exists()) {
   358         if (!input.exists()) {
   352             input.mkdir();
   359             input.mkdir();