var fs = require("fs") var path = require("path") var listRealPath = path.resolve(__dirname); var newPath = path.resolve(__dirname+'/newFile'); // 整合到 新文件夹的名称 需要手动创建 或者更改为已存在的名称 var formatList = ['avi', 'mp4', 'mov', 'rmvb', 'mkv']; re
1.复制文件夹 public static void copyDir(String oldPath, String newPath) throws IOException { File file = new File(oldPath); //文件名称列表 String[] filePath = file.list(); if (!(new File(newPath)).exists()) { (new File(newPath)).mkdir(); } for (int i = 0; i < f