test/jdk/tools/jpackage/helpers/JPackageHelper.java
branchJDK-8200758-branch
changeset 57405 539d8b3f9e1e
parent 57395 521c02b9eed0
child 57414 6eda749d3117
equal deleted inserted replaced
57404:a477b26bf888 57405:539d8b3f9e1e
    23 
    23 
    24 import java.io.File;
    24 import java.io.File;
    25 import java.io.IOException;
    25 import java.io.IOException;
    26 import java.io.PrintWriter;
    26 import java.io.PrintWriter;
    27 import java.io.StringWriter;
    27 import java.io.StringWriter;
    28 import java.io.FileWriter;
       
    29 import java.io.BufferedWriter;
    28 import java.io.BufferedWriter;
    30 import java.nio.file.FileVisitResult;
    29 import java.nio.file.FileVisitResult;
    31 
    30 
    32 import java.nio.file.Files;
    31 import java.nio.file.Files;
    33 import java.nio.file.Path;
    32 import java.nio.file.Path;
   196         });
   195         });
   197     }
   196     }
   198 
   197 
   199     public static void deleteOutputFolder(String output) throws IOException {
   198     public static void deleteOutputFolder(String output) throws IOException {
   200         File outputFolder = new File(output);
   199         File outputFolder = new File(output);
   201         System.out.println("AMDEBUG output: " + outputFolder.getAbsolutePath());
   200         System.out.println("deleteOutputFolder: " + outputFolder.getAbsolutePath());
   202         try {
   201         try {
   203             deleteRecursive(outputFolder);
   202             deleteRecursive(outputFolder);
   204         } catch (IOException ioe) {
   203         } catch (IOException ioe) {
   205             System.err.println("IOException: " + ioe);
   204             System.err.println("IOException: " + ioe);
   206             ioe.printStackTrace(System.err);
   205             ioe.printStackTrace(System.err);
   310         }
   309         }
   311 
   310 
   312         Path src = Path.of(TEST_SRC_ROOT + File.separator + "apps"
   311         Path src = Path.of(TEST_SRC_ROOT + File.separator + "apps"
   313                 + File.separator + testType + File.separator + name + ".java");
   312                 + File.separator + testType + File.separator + name + ".java");
   314         Path dst = Path.of(name + ".java");
   313         Path dst = Path.of(name + ".java");
   315         
   314 
   316         if (dst.toFile().exists()) {
   315         if (dst.toFile().exists()) {
   317             Files.delete(dst);
   316             Files.delete(dst);
   318         }
   317         }
   319         Files.copy(src, dst);
   318         Files.copy(src, dst);
   320 
   319 
   626             return sb.toString();
   625             return sb.toString();
   627         }
   626         }
   628 
   627 
   629         return in;
   628         return in;
   630     }
   629     }
   631 
       
   632 }
   630 }