We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 99fc3a9 commit dc33f73Copy full SHA for dc33f73
1 file changed
src/utils/FileUtils.java
@@ -19,7 +19,18 @@
19
public class FileUtils {
20
21
public static void main(String[] args) {
22
- getCodeLinesDetail("E:\\work\\ChildrenRead\\app\\src\\main");
+ batchRename("E:\\work\\icons", "video_living_%s");
23
+ }
24
+
25
+ /**
26
+ * 批量重命名
27
+ * @param formatter 重命名格式,xxx %s xxx,其中%s为原有名称
28
+ */
29
+ private static void batchRename(String dirPath, String formatter) {
30
+ for (File file : getAllFiles(dirPath)) {
31
+ File newFile = new File(file.getParentFile(), String.format(formatter, file.getName()));
32
+ copyFileByChannel(file, newFile);
33
34
}
35
36
/**
0 commit comments