优化自动打包工具
parent
c2f67e8c1f
commit
2883d901b8
|
@ -69,6 +69,7 @@ public class FileTreeBuilder {
|
|||
System.out.println("Invalid directory path: " + directoryPath);
|
||||
return null;
|
||||
}
|
||||
System.out.println(blackList);
|
||||
return buildFileTreeRecursively(root, blackList);
|
||||
}
|
||||
|
||||
|
@ -96,7 +97,7 @@ public class FileTreeBuilder {
|
|||
if (files != null) {
|
||||
for (File file : files) {
|
||||
if (file.isDirectory()) {
|
||||
if (!isBlacklisted(file.getAbsolutePath(), blacklistPrefixes)) {
|
||||
if (!isBlacklisted(file.getPath(), blacklistPrefixes)) {
|
||||
FileInfo child = buildFileTreeRecursively(file, blacklistPrefixes);
|
||||
fileInfo.addChild(child);
|
||||
}
|
||||
|
@ -125,10 +126,11 @@ public class FileTreeBuilder {
|
|||
if (filePath.endsWith(".DS_Store") || filePath.endsWith(".DSStore")) {
|
||||
return true;
|
||||
}
|
||||
System.out.println("黑名单过滤文件:" + filePath);
|
||||
for (String prefix : blacklistPrefixes) {
|
||||
String path = FileTreeBuilder.class.getResource("").getPath();
|
||||
String prefixPath = path.substring(0, path.indexOf(File.separator + "target" + File.separator)) + File.separator;
|
||||
if (filePath.startsWith(prefixPath + prefix)) {
|
||||
// // String path = FileTreeBuilder.class.getResource("").getPath();
|
||||
// String prefixPath = path.substring(0, path.indexOf(File.separator + "target" + File.separator)) + File.separator;
|
||||
if (filePath.startsWith(prefix)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue