< prev index next >

src/jdk.jpackage/share/classes/jdk/jpackage/internal/IOUtils.java

Print this page

        

@@ -77,25 +77,11 @@
             }
         });
     }
 
     public static void copyRecursive(Path src, Path dest) throws IOException {
-        Files.walkFileTree(src, new SimpleFileVisitor<Path>() {
-            @Override
-            public FileVisitResult preVisitDirectory(final Path dir,
-                    final BasicFileAttributes attrs) throws IOException {
-                Files.createDirectories(dest.resolve(src.relativize(dir)));
-                return FileVisitResult.CONTINUE;
-            }
-
-            @Override
-            public FileVisitResult visitFile(final Path file,
-                    final BasicFileAttributes attrs) throws IOException {
-                Files.copy(file, dest.resolve(src.relativize(file)));
-                return FileVisitResult.CONTINUE;
-            }
-        });
+        copyRecursive(src, dest, List.of());
     }
 
     public static void copyRecursive(Path src, Path dest,
             final List<String> excludes) throws IOException {
         Files.walkFileTree(src, new SimpleFileVisitor<Path>() {

@@ -146,27 +132,10 @@
             destFile.setReadOnly();
         }
         destFile.setReadable(true, false);
     }
 
-    public static long getFolderSize(File folder) {
-        long foldersize = 0;
-
-        File[] children = folder.listFiles();
-        if (children != null) {
-            for (File f : children) {
-                if (f.isDirectory()) {
-                    foldersize += getFolderSize(f);
-                } else {
-                    foldersize += f.length();
-                }
-            }
-        }
-
-        return foldersize;
-    }
-
     // run "launcher paramfile" in the directory where paramfile is kept
     public static void run(String launcher, File paramFile)
             throws IOException {
         if (paramFile != null && paramFile.exists()) {
             ProcessBuilder pb =
< prev index next >