Back to index

wims  3.65+svn20090927
Public Member Functions | Protected Member Functions | Package Functions | Package Attributes
rene.dialogs.FileListFinder Class Reference
Inheritance diagram for rene.dialogs.FileListFinder:
Inheritance graph
[legend]
Collaboration diagram for rene.dialogs.FileListFinder:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 FileListFinder (String dir, String pattern, boolean recurse)
boolean file (File file)
String getResult ()
void setCase (boolean usecase)
void search ()
Enumeration files ()
 Return an Enumeration with the files.
Enumeration dirs ()
 Return an Enumeration with the directories.
int size ()
void sort ()
 Sort the result.
void sort (int type)
void stopIt ()
 This stops the search from other threads.
String getDir ()
 Returns a canonical version of the directory.

Protected Member Functions

boolean directory (File dir)
void parsed (File dir)

Package Functions

void find (File dir, FileFilter filter)
boolean match (char filename[], int n, char filter[], int m)

Package Attributes

String Res
Vector V = new Vector()
Vector Vdir = new Vector()
boolean Stop
boolean Recurse
String Dir
String Filter
boolean UseCase = false

Detailed Description

Definition at line 26 of file SearchFileDialog.java.


Constructor & Destructor Documentation

rene.dialogs.FileListFinder.FileListFinder ( String  dir,
String  pattern,
boolean  recurse 
) [inline]

Definition at line 28 of file SearchFileDialog.java.

       {      super(dir,pattern,recurse);
       }

Member Function Documentation

boolean rene.util.FileList.directory ( File  dir) [inline, protected, inherited]
Parameters:
fileThe directory that has been found.
Returns:
false if recursion should stop here. (i.e. that directory needs not be parsed).

Definition at line 183 of file FileList.java.

       {      return true;
       }

Here is the caller graph for this function:

Enumeration rene.util.FileList.dirs ( ) [inline, inherited]

Return an Enumeration with the directories.

Definition at line 149 of file FileList.java.

       {      return Vdir.elements();
       }

Here is the caller graph for this function:

boolean rene.dialogs.FileListFinder.file ( File  file) [inline]
Parameters:
fileThe file that has been found.
Returns:
false if you need no more file at all.

Reimplemented from rene.util.FileList.

Definition at line 31 of file SearchFileDialog.java.

       {      try
              {      Res=file.getCanonicalPath();
              }
              catch (Exception e) {}
              return false;
       }
Enumeration rene.util.FileList.files ( ) [inline, inherited]

Return an Enumeration with the files.

Definition at line 143 of file FileList.java.

       {      return V.elements();
       }

Here is the caller graph for this function:

void rene.util.FileList.find ( File  dir,
FileFilter  filter 
) [inline, package, inherited]

Definition at line 98 of file FileList.java.

       {      if (!directory(dir)) return;
              String list[]=dir.list();
              loop : for (int i=0; i<list.length; i++)
              {      SortFile file=new SortFile(dir,list[i]);
                     if (file.isDirectory()) 
                     {      Vdir.addElement(file);
                            if (Recurse) find(file,filter);
                     }
                     else 
                     {      String filename=file.getName();
                            if (!UseCase) filename=filename.toLowerCase();
                            char fn[]=filename.toCharArray();
                            for (int j=0; j<filter.filterCount(); j++)
                            {      if (match(fn,0,filter.filter(j),0))
                                   {      Stop=!file(file);
                                          if (Stop) break loop;
                                          V.addElement(file);
                                   }
                            }
                     }
                     if (Stop) break;
              }
              parsed(dir);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

String rene.util.FileList.getDir ( ) [inline, inherited]

Returns a canonical version of the directory.

Definition at line 208 of file FileList.java.

       {      File dir=new File(Dir);
              try
              {      return (dir.getCanonicalPath());
              }
              catch (Exception e)
              {      return "Dir does not exist!";
              }
       }

Definition at line 38 of file SearchFileDialog.java.

       {      return Res; 
       }

Here is the caller graph for this function:

boolean rene.util.FileList.match ( char  filename[],
int  n,
char  filter[],
int  m 
) [inline, package, inherited]

Definition at line 123 of file FileList.java.

       {      if (filter==null) return true;
              if (m>=filter.length) return n>=filename.length;
              if (n>=filename.length) return m==filter.length-1 && filter[m]=='*';
              if (filter[m]=='?')
              {      return match(filename,n+1,filter,m+1);
              }
              if (filter[m]=='*')
              {      if (m==filter.length-1) return true;
                     for (int i=n; i<filename.length; i++)
                     {      if (match(filename,i,filter,m+1)) return true;
                     }
                     return false;
              }
              if (filter[m]==filename[n]) return match(filename,n+1,filter,m+1);
              return false;
       }

Here is the caller graph for this function:

void rene.util.FileList.parsed ( File  dir) [inline, protected, inherited]
Parameters:
parsedThe directory that has been parsed.

Definition at line 196 of file FileList.java.

       {
       }

Here is the caller graph for this function:

void rene.util.FileList.search ( ) [inline, inherited]

Definition at line 92 of file FileList.java.

       {      Stop=false;   
              File file=new File(Dir);
              if (!UseCase) Filter=Filter.toLowerCase();
              if (file.isDirectory()) find(file,new FileFilter(Filter));
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.util.FileList.setCase ( boolean  usecase) [inline, inherited]

Definition at line 89 of file FileList.java.

       {      UseCase=usecase;
       }

Here is the caller graph for this function:

int rene.util.FileList.size ( ) [inline, inherited]
Returns:
The number of files found.

Definition at line 155 of file FileList.java.

       {      return V.size();
       }
void rene.util.FileList.sort ( ) [inline, inherited]

Sort the result.

Definition at line 161 of file FileList.java.

       {      int i,n=V.size();
              SortObject v[]=new SortObject[n];
              for (i=0; i<n; i++) v[i]=(SortFile)V.elementAt(i);
              Sorter.sort(v);
              for (i=0; i<n; i++) V.setElementAt(v[i],i);
              n=Vdir.size();
              v=new SortObject[n];
              for (i=0; i<n; i++) v[i]=(SortFile)Vdir.elementAt(i);
              Sorter.sort(v);
              for (i=0; i<n; i++) Vdir.setElementAt(v[i],i);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.util.FileList.sort ( int  type) [inline, inherited]

Definition at line 173 of file FileList.java.

       {      SortFile.SortBy=type;
              sort();
              SortFile.SortBy=SortFile.NAME;
       }

Here is the call graph for this function:

void rene.util.FileList.stopIt ( ) [inline, inherited]

This stops the search from other threads.

Definition at line 202 of file FileList.java.

       {      Stop=true;
       }

Here is the caller graph for this function:


Member Data Documentation

String rene.util.FileList.Dir [package, inherited]

Definition at line 67 of file FileList.java.

String rene.util.FileList.Filter [package, inherited]

Definition at line 67 of file FileList.java.

boolean rene.util.FileList.Recurse [package, inherited]

Definition at line 66 of file FileList.java.

Definition at line 27 of file SearchFileDialog.java.

boolean rene.util.FileList.Stop [package, inherited]

Definition at line 65 of file FileList.java.

boolean rene.util.FileList.UseCase = false [package, inherited]

Definition at line 68 of file FileList.java.

Vector rene.util.FileList.V = new Vector() [package, inherited]

Definition at line 64 of file FileList.java.

Vector rene.util.FileList.Vdir = new Vector() [package, inherited]

Definition at line 64 of file FileList.java.


The documentation for this class was generated from the following file: