Re: FilenameFilter woes
Andrew,
I did not see, when I initially read your post, how it was
helpful. However, now I do. I will make a shorter example, which
makes sense. There`s hardly any way for someone to quickly take a
look at what I initially posted. In addition, since I`ve made no
progress, there`s no good alternatives, anyway.
As for the recursion, this was just something else which I thought
might be involved in the problem. However, I made a couple of small
programs that shows that recursion itself is not the problem. I
thought that, perhaps, it had something to do with me creating new
File types in the recursion. You may find them below, hopefully in a
usable format. However, in retrospect, I don`t know why you would
want them.
Thank you, Alan
import java.io.*;
import java.util.*;
public class TryRecursion
{
public static void main(String[] args)
{
File afile = new File("appClass.class");
recurs(afile);
}
public static void recurs ( File file )
{
if (file.exists())
{ System.out.println(file.getName() + " exists"); }
else
{ System.out.println(file.getName() + " does NOT exist!!!"); }
File afile = new File("appClass2.class");
recurs(afile);
}
}
import java.io.*;
import java.util.*;
public class Bonehead
{
public static void main(String[] args)
{
File file1 = new File("appClass.class");
if (file1.exists())
{ System.out.println("file1 exists"); }
else
{ System.out.println("file1 does NOT exist!!!"); }
File file2 = new File("appClass2.class");
if (file2.exists())
{ System.out.println("file2 exists"); }
else
{ System.out.println("file2 does NOT exist!!!"); }
File file3 = new File("appClass.class");
if (file3.exists())
{ System.out.println("file3 exists"); }
else
{ System.out.println("file3 does NOT exist!!!"); }
}
}