home *** CD-ROM | disk | FTP | other *** search
- package netscape.netcast;
-
- import java.io.File;
- import java.util.Enumeration;
- import java.util.NoSuchElementException;
-
- final class FileCacheEnumeration implements Enumeration {
- FileCache cache;
- File base;
- File dir;
- // $FF: renamed from: i int
- int field_0;
- // $FF: renamed from: j int
- int field_1;
- String[] dirs;
- String[] files;
- Object next;
-
- FileCacheEnumeration(FileCache cache, File base) {
- this.cache = cache;
- this.base = base;
- this.dirs = base.list();
- this.next = this.getNext();
- }
-
- Object getNext() {
- while(this.dirs != null && this.field_0 < this.dirs.length) {
- if (this.files != null && this.field_1 < this.files.length) {
- return new FileCacheFile(this.cache, this.dir, this.files[this.field_1++], -1L);
- }
-
- this.dir = new File(this.base, this.dirs[this.field_0++]);
- this.files = this.dir.list();
- this.field_1 = 0;
- }
-
- return null;
- }
-
- public boolean hasMoreElements() {
- return this.next != null;
- }
-
- public Object nextElement() {
- Object file = this.next;
- if (file == null) {
- throw new NoSuchElementException();
- } else {
- this.next = this.getNext();
- return file;
- }
- }
- }
-