com.mkdoc.io
Class FileSpider

java.lang.Object
  |
  +--com.mkdoc.io.FileSpider

public class FileSpider
extends java.lang.Object

A file system spider for crawling directories from a base location.

Version:
0.1 2005-12-06
Author:
Philip Shaw

Constructor Summary
FileSpider(ApplicationContext context)
          Create a spider from an application context.
 
Method Summary
 void crawl(java.io.File baseDir)
          Start crawling from a base directory.
 void crawl(java.io.File baseDir, int depth)
          Start crawling from a base directory.
static void main(java.lang.String[] args)
          Main entry point for running the file spider.
 void parseFile(java.io.File file)
          Parse an individual file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSpider

public FileSpider(ApplicationContext context)
Create a spider from an application context.

Parameters:
context - The application context for the spider, which must include standard parameters required for StoreManager configuration.
Since:
Version 0.1 2005-12-06
Method Detail

crawl

public final void crawl(java.io.File baseDir)
Start crawling from a base directory.

Parameters:
baseDir - The directory from which to start crawling.
Since:
Version 0.1 2005-12-06

crawl

public final void crawl(java.io.File baseDir,
                        int depth)
Start crawling from a base directory.

Parameters:
baseDir - The directory from which to start crawling.
depth - The number of child directories levels to descend into.
Since:
Version 0.1 2005-12-06

parseFile

public final void parseFile(java.io.File file)
                     throws java.io.IOException,
                            org.xml.sax.SAXException
Parse an individual file.

Parameters:
file - The file to parse.
Throws:
java.io.IOException - If there is a problem reading the file input or file output.
org.xml.sax.SAXException - If there is a problem parsing the source document.
Since:
Version 0.1 2005-12-06

main

public static void main(java.lang.String[] args)
Main entry point for running the file spider.

Parameters:
args - Application context parameters: 1. The base directory to crawl. 2. The store manager class name. 3. The recursion depth (optional) 4. The absolute store path (file storage, optional) 5. The repository reference (file storage, optional).
Since:
Version 0.1 2005-12-06