hi,
mybe this would be an option:
> > class directoryFilter implements IFSFileFilter {
List fileNameList = new ArrayList();
> > public boolean accept(IFSFile file) {
> > try {
> > if (!file.isDirectory()) {
> > System.out.print(file.getName());
dirNameList.add(file.getName());
> > }
> > return true;
> > }
> > catch (Exception e) {
> > return false;
> > }
> > }
public String[] getFileNames () {
return (String[])fileNameList.toArray(new String[0]);
}
> > }
in your main mthod:
directoryFilter dirFilter = new directoryFilter();
String[] directoryNames = directory.list(dirFilter,"*");
String[] fileNames = dirFilter.getFileNames();
hope this helps!
-mw
----- Original Message -----
From: "Mike Wills" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 20, 2001 2:42 AM
Subject: Re: Changing an Java program to a servlet
> Okay, I guess I sent this message a bit soon. I have converted most of the
> program, but there is one problem, I can't get the file name from the
second
> class. I have to pass a Boolean back to the main program. What can be done
> to get this file name passed in some form or fashion? Would an array
> possibly work?
>
> > class directoryFilter implements IFSFileFilter {
> > public boolean accept(IFSFile file) {
> > try {
> > if (!file.isDirectory()) {
> > System.out.print(file.getName());
> > }
> > return true;
> > }
> > catch (Exception e) {
> > return false;
> > }
> > }
> > }
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html