Kafenio.editor 0.8.5

de.xeinfach.kafenio.util
Class TreeSpider

java.lang.Object
  extended byde.xeinfach.kafenio.util.TreeSpider

public class TreeSpider
extends java.lang.Object

* Description: TreeSpider Utility class for traversing, scanning & describing directory/file structures * * @author Howard Kistler


Constructor Summary
TreeSpider()
          constructs a new TreeSpider Object using the given values.
TreeSpider(java.lang.String origin)
          constructs a new TreeSpider Object using the given values
TreeSpider(java.lang.String origin, boolean caseSensitive)
          constructs a new TreeSpider Object using the given values
TreeSpider(java.lang.String origin, boolean caseSensitive, int mDepth)
          constructs a new TreeSpider Object using the given values
TreeSpider(java.lang.String origin, int mDepth)
          constructs a new TreeSpider Object using the given values
TreeSpider(java.lang.String origin, java.util.Vector exts, boolean caseSensitive)
          constructs a new TreeSpider Object using the given values
TreeSpider(java.lang.String origin, java.util.Vector exts, boolean caseSensitive, int mDepth)
          constructs a new TreeSpider Object using the given values
 
Method Summary
 java.util.Hashtable collectListing()
          * Returns a directory-style listing of the file tree * @return Returns a directory-style listing of the file tree
 boolean doScreenExtensions()
           
 java.util.Vector fetchMassListing()
          * Returns an unsorted listing of the file tree * @return Returns an unsorted listing of the file tree
 javax.swing.tree.DefaultTreeModel fetchTree()
          * Returns a DefaultTreeModel built from the preset root file * @return Returns a DefaultTreeModel built from the preset root file
 javax.swing.tree.DefaultTreeModel fetchTree(java.io.File newRootFile)
          * Returns a DefaultTreeModel built from the specified root file * @param newRootFile new root file * @return Returns a DefaultTreeModel built from the specified root file
 boolean getDisplayMode()
           
 java.util.Vector getExtensions()
           
 java.util.Vector getFiles()
           
 int getMaxDepth()
           
 java.io.File getRootFile()
           
static void main(java.lang.String[] args)
          Class'es main() method
 void setDisplayMode(boolean mode)
          sets the display mode
 void setExtensions(java.util.Vector vc)
          set file extensions * @param vc list of file extensions
 void setFileNamesOnly(boolean b)
           
 void setFiles(java.util.Vector vc)
          sets the list of files * @param vc list of files as vector.
 void setMaxDepth(int i)
          sets the max allowed folder depth * @param i maximum depth
 void setRootFile(java.io.File f)
          sets the root file
 void setScreenExtensions(boolean b)
          set to true if file extensions should be screened, false otherwise
 boolean showFileNamesOnly()
           
 java.util.Vector sortFileListing()
          * Returns an index-style listing of the file tree of file names only * @return Returns an index-style listing of the file tree of file names only
 java.util.Vector sortMassListing()
          Returns an index-style listing of the file tree of complete file names and paths * @return Returns an index-style listing of the file tree of complete file names and paths
static void unitTest(java.lang.String dir)
          * Unit test method for testing the code with example settings * @param dir directory for unit testing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeSpider

public TreeSpider(java.lang.String origin,
                  java.util.Vector exts,
                  boolean caseSensitive,
                  int mDepth)
constructs a new TreeSpider Object using the given values. * @param origin path origin * @param exts allowed file extensions * @param caseSensitive case sensitive on/off * @param mDepth maximum path depth allowed


TreeSpider

public TreeSpider(java.lang.String origin,
                  java.util.Vector exts,
                  boolean caseSensitive)
constructs a new TreeSpider Object using the given values. * @param origin path origin * @param exts allowed file extensions * @param caseSensitive case sensitive on/off


TreeSpider

public TreeSpider(java.lang.String origin,
                  boolean caseSensitive,
                  int mDepth)
constructs a new TreeSpider Object using the given values. * @param origin path origin * @param caseSensitive case sensitive on/off * @param mDepth maximum path depth allowed


TreeSpider

public TreeSpider(java.lang.String origin,
                  boolean caseSensitive)
constructs a new TreeSpider Object using the given values. * @param origin path origin * @param caseSensitive case sensitive on/off


TreeSpider

public TreeSpider(java.lang.String origin,
                  int mDepth)
constructs a new TreeSpider Object using the given values. * @param origin path origin * @param mDepth maximum path depth allowed


TreeSpider

public TreeSpider(java.lang.String origin)
constructs a new TreeSpider Object using the given values. * @param origin path origin


TreeSpider

public TreeSpider()
constructs a new TreeSpider Object using the given values.

Method Detail

getRootFile

public java.io.File getRootFile()
Returns:
returns the root file

setRootFile

public void setRootFile(java.io.File f)
sets the root file. * @param f a file


getFiles

public java.util.Vector getFiles()
Returns:
returns the list of files

setFiles

public void setFiles(java.util.Vector vc)
sets the list of files * @param vc list of files as vector.


getMaxDepth

public int getMaxDepth()
Returns:
returns currently set maximum folder depth

setMaxDepth

public void setMaxDepth(int i)
sets the max allowed folder depth * @param i maximum depth


doScreenExtensions

public boolean doScreenExtensions()
Returns:
returns true if file extensions are screened, false otherwise.

setScreenExtensions

public void setScreenExtensions(boolean b)
set to true if file extensions should be screened, false otherwise. * @param b boolean value that defines wether to screen file extensions or not.


showFileNamesOnly

public boolean showFileNamesOnly()
Returns:
returns true if filenames only should be displayed, false otherwise.

setFileNamesOnly

public void setFileNamesOnly(boolean b)
Parameters:
b - sets if only filenames should be shown.

getDisplayMode

public boolean getDisplayMode()
Returns:
returns the displaying mode of the files

setDisplayMode

public void setDisplayMode(boolean mode)
sets the display mode. * @param mode can be true or false.


getExtensions

public java.util.Vector getExtensions()
Returns:
returns valid file extensions as vector.

setExtensions

public void setExtensions(java.util.Vector vc)
set file extensions * @param vc list of file extensions


fetchTree

public javax.swing.tree.DefaultTreeModel fetchTree(java.io.File newRootFile)
* Returns a DefaultTreeModel built from the specified root file * @param newRootFile new root file * @return Returns a DefaultTreeModel built from the specified root file


fetchTree

public javax.swing.tree.DefaultTreeModel fetchTree()
* Returns a DefaultTreeModel built from the preset root file * @return Returns a DefaultTreeModel built from the preset root file


fetchMassListing

public java.util.Vector fetchMassListing()
* Returns an unsorted listing of the file tree * @return Returns an unsorted listing of the file tree


sortMassListing

public java.util.Vector sortMassListing()
Returns an index-style listing of the file tree of complete file names and paths * @return Returns an index-style listing of the file tree of complete file names and paths


sortFileListing

public java.util.Vector sortFileListing()
* Returns an index-style listing of the file tree of file names only * @return Returns an index-style listing of the file tree of file names only


collectListing

public java.util.Hashtable collectListing()
* Returns a directory-style listing of the file tree * @return Returns a directory-style listing of the file tree


unitTest

public static void unitTest(java.lang.String dir)
* Unit test method for testing the code with example settings * @param dir directory for unit testing.


main

public static void main(java.lang.String[] args)
Class'es main() method. * @param args commandline arguments.


Kafenio.editor 0.8.5

Copyright © 2003-2004 by Karsten Pawlik. All Rights Reserved. Published under the Lesser General Public License (LGPL)