diff --git a/src/fr/devinsy/util/FileIterator.java b/src/fr/devinsy/util/FileIterator.java index 244bba0..af6e293 100644 --- a/src/fr/devinsy/util/FileIterator.java +++ b/src/fr/devinsy/util/FileIterator.java @@ -1,6 +1,7 @@ package fr.devinsy.util; import java.io.File; + import java.util.Iterator; import java.util.Vector; import java.util.regex.Pattern; @@ -240,7 +241,8 @@ public class FileIterator extends Vector implements Iterator< static public boolean isLink(File file) throws Exception { boolean result; - if (file.getCanonicalPath().equals(file.getAbsolutePath())) + + if ((file.exists()) && (file.getCanonicalPath().equals(file.getAbsolutePath()))) { result = false; } @@ -390,8 +392,7 @@ public class FileIterator extends Vector implements Iterator< int result; result = 0; - File f; - while ((f = this.next()) != null) + while (this.next() != null) { result += 1; } @@ -401,6 +402,48 @@ public class FileIterator extends Vector implements Iterator< } + /** + * + */ + public int fileFinalCountdown() + { + int result; + + result = 0; + while (this.hasNext()) + { + if (!this.next().isDirectory()) + { + result += 1; + } + } + + // + return(result); + } + + + /** + * + */ + public int directoryFinalCountdown() + { + int result; + + result = 0; + while (this.hasNext()) + { + if (this.next().isDirectory()) + { + result += 1; + } + } + + // + return(result); + } + + /** * */ diff --git a/src/fr/devinsy/util/FileIteratorState.java b/src/fr/devinsy/util/FileIteratorState.java index b3457b1..58f9b9f 100644 --- a/src/fr/devinsy/util/FileIteratorState.java +++ b/src/fr/devinsy/util/FileIteratorState.java @@ -6,7 +6,7 @@ import java.util.regex.Pattern; /** - * + * Used by FileIterator class. */ public class FileIteratorState implements Iterator {