Skip to content

Commit

Permalink
[INLONG-9102][Agent] Add file utils
Browse files Browse the repository at this point in the history
Delete invalid code
  • Loading branch information
justinwwhuang committed Oct 24, 2023
1 parent 59f362a commit 80e3731
Showing 1 changed file with 0 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,6 @@ public class FileFinderIterator implements Iterator<File> {
* @param fileFilter The {@link Predicate} that is used as filter to find specific
* files.
*/
// public FileFinderIterator(File baseDir, Predicate<File> yieldFilter,
// Predicate<File> branchFilter, Predicate<File> fileFilter) {
// this.yieldFilter = yieldFilter;
// this.branchFilter = branchFilter;
// this.fileFilter = fileFilter;
// this.maxDepth = 1;
// // fileStack.addAll(Arrays.asList(baseDir.listFiles()));
// for(File f : baseDir.listFiles()) {
// depthStack.add(new DepthControl(1, f));
// }
// }
public FileFinderIterator(File baseDir, Predicate<File> yieldFilter,
Predicate<File> branchFilter, Predicate<File> fileFilter,
Predicate<File> dirFilter, int maxDepth) {
Expand All @@ -85,7 +74,6 @@ public FileFinderIterator(File baseDir, Predicate<File> yieldFilter,
this.fileFilter = fileFilter;
this.maxDepth = maxDepth;
this.dirFilter = dirFilter;
// fileStack.addAll(Arrays.asList(baseDir.listFiles()));
File[] listFiles = baseDir.listFiles();
if (listFiles != null) {
for (File f : listFiles) {
Expand Down Expand Up @@ -122,20 +110,6 @@ public File next() {
* Fills the result queue by processing the files and directories from fileStack.
*/
private void populateResults() {

// while (!fileStack.isEmpty() && resultQueue.isEmpty()) {
// File currentFile = fileStack.pop();
//
// if (yieldFilter.apply(currentFile) && fileFilter.apply(currentFile))
// {
// resultQueue.offer(currentFile);
// }
//
// if (currentFile.isDirectory() && branchFilter.apply(currentFile)) {
// pushAllOnTop(fileStack, currentFile.listFiles());
// }
// }

while (!depthStack.isEmpty() && resultQueue.isEmpty()) {
DepthControl currentDepthControl = depthStack.pop();
File currentFile = currentDepthControl.getFile();
Expand Down

0 comments on commit 80e3731

Please sign in to comment.