Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/BuildManager.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/BuildManager.java	(revision 8488)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/BuildManager.java	(revision 8489)
@@ -12,139 +12,145 @@
 public class BuildManager 
 {
-  CollectionManager collectionManager;
-  RecogniserManager recogniserManager;
-  IndexerManager    indexerManager;
-  ClassifierManager classifierManager;
-  ExtractorManager  extractorManager;
-  DocumentList      docList;
-  List              inputRoots;
-  String            outputDir;
-  String            archiveDir;
+    CollectionManager collectionManager;
+    RecogniserManager recogniserManager;
+    IndexerManager    indexerManager;
+    ClassifierManager classifierManager;
+    ExtractorManager  extractorManager;
+    DocumentList      docList;
+    List              inputRoots;
+    String            outputDir;
+    String            archiveDir;
 	
-  public BuildManager(List inputRoots, String site, String collection, String outputDir)
-  {
-    // get the collection configuration information
-    this.collectionManager = new CollectionManager(site, collection);
-    this.collectionManager.setBuildManager(this);
-    // set up the list of input directories
-    if (inputRoots.size() == 0) {
-      inputRoots.add(this.collectionManager.getImportDirectory());
-      System.out.println("Adding collection import directory to input list " + this.collectionManager.getImportDirectory());
+    public BuildManager(List inputRoots, String site, String collection, String outputDir)
+    {
+	// get the collection configuration information
+	this.collectionManager = new CollectionManager(site, collection);
+	this.collectionManager.setBuildManager(this);
+	// set up the list of input directories
+	if (inputRoots.size() == 0) {
+	    inputRoots.add(this.collectionManager.getImportDirectory());
+	    System.out.println("Adding collection import directory to input list " + this.collectionManager.getImportDirectory());
+	}
+	this.docList = new DocumentList(new DocumentIDFactory(this.collectionManager), 
+					this.collectionManager.getDatabase());
+	this.inputRoots = inputRoots;
+    
+	// set up the output directory
+	this.outputDir  = outputDir != null ? outputDir : this.collectionManager.getBuildDirectory();
+	File outputDirFile = new File(this.outputDir);
+	if (!outputDirFile.exists() || !outputDirFile.isDirectory()) {
+	    System.err.println("Unable to open directory " + this.outputDir + " for writing");
+	    System.exit(1);
+	}
+	System.out.println("Output directory set to " + this.outputDir);
+
+	this.archiveDir = this.collectionManager.getArchiveDirectory();
+
+	// TODO: initialise the expanders here...
+
+	// initialise any recognisers
+	this.recogniserManager = new RecogniserManager();
+	RecogniserInterface recogniser = new HTMLRecogniser(docList);
+	recogniserManager.addRecogniser(recogniser);
+	recogniserManager.addRecogniser(new IndexRecogniser(docList));
+	recogniser = new TextRecogniser(docList);
+	recogniserManager.addRecogniser(recogniser);
+	recogniser = new JPEGRecogniser(docList);
+	recogniserManager.addRecogniser(recogniser);
+	/*    recogniser = new ExtXMLRecogniser(docList);
+	      recogniserManager.addRecogniser(recogniser);*/
+	recogniser = new MetadataRecogniser(docList);
+	recogniserManager.addRecogniser(recogniser);
+	recogniser = new GS2METSRecogniser(docList);
+	recogniserManager.addRecogniser(recogniser);
+
+	// set up the extractors
+	this.extractorManager  = new ExtractorManager(this.docList);
+	this.extractorManager.addExtractor(new IndexExtractor());
+	/*    this.extractorManager.addExtractor(new ExtXMLExtractor());*/
+	this.extractorManager.addExtractor(new MetaXMLExtractor());
+    
+	// TODO: set up the enrichers...
+    
+	// set up the classifiers
+	this.classifierManager = new ClassifierManager(this.docList, collectionManager.getDatabase());
+        
+	// set up the indexers
+	this.indexerManager = new IndexerManager(this.docList);
+
+	// configure the collection
+	this.collectionManager.configureCollection();
+
+	// prepare a file crawler on the etc directory, and a crawl observer to respond to
+	// the appropriate files.
+	FileCrawler fileCrawler = new FileCrawler(new File(this.collectionManager.getEtcDirectory()), 
+						  new CollectionCrawlObserver(this));
+
+	fileCrawler.crawl();    
     }
-    this.docList = new DocumentList(new DocumentIDFactory(this.collectionManager), 
-				    this.collectionManager.getDatabase());
-    this.inputRoots = inputRoots;
-    
-    // set up the output directory
-    this.outputDir  = outputDir != null ? outputDir : this.collectionManager.getBuildDirectory();
-    File outputDirFile = new File(this.outputDir);
-    if (!outputDirFile.exists() || !outputDirFile.isDirectory()) {
-	System.err.println("Unable to open directory " + this.outputDir + " for writing");
-	System.exit(1);
-    }
-    System.out.println("Output directory set to " + this.outputDir);
-
-    this.archiveDir = this.collectionManager.getArchiveDirectory();
-
-    // TODO: initialise the expanders here...
-
-    // initialise any recognisers
-    this.recogniserManager = new RecogniserManager();
-    RecogniserInterface recogniser = new HTMLRecogniser(docList);
-    recogniserManager.addRecogniser(recogniser);
-    recogniserManager.addRecogniser(new IndexRecogniser(docList));
-    recogniser = new TextRecogniser(docList);
-    recogniserManager.addRecogniser(recogniser);
-    recogniser = new JPEGRecogniser(docList);
-    recogniserManager.addRecogniser(recogniser);
-    /*    recogniser = new ExtXMLRecogniser(docList);
-	  recogniserManager.addRecogniser(recogniser);*/
-    recogniser = new MetadataRecogniser(docList);
-    recogniserManager.addRecogniser(recogniser);
-    recogniser = new GS2METSRecogniser(docList);
-    recogniserManager.addRecogniser(recogniser);
-
-    // set up the extractors
-    this.extractorManager  = new ExtractorManager(this.docList);
-    this.extractorManager.addExtractor(new IndexExtractor());
-    /*    this.extractorManager.addExtractor(new ExtXMLExtractor());*/
-    this.extractorManager.addExtractor(new MetaXMLExtractor());
-    
-    // TODO: set up the enrichers...
-    
-    // set up the classifiers
-    this.classifierManager = new ClassifierManager(this.docList, collectionManager.getDatabase());
-        
-    // set up the indexers
-    this.indexerManager = new IndexerManager(this.docList);
-
-    // configure the collection
-    this.collectionManager.configureCollection();
-
-    // prepare a file crawler on the etc directory, and a crawl observer to respond to
-    // the appropriate files.
-    FileCrawler fileCrawler = new FileCrawler(new File(this.collectionManager.getEtcDirectory()), 
-					      new CollectionCrawlObserver(this));
-
-    fileCrawler.crawl();    
-  }
   
-  public String getLastBuildSequence()
-  { return this.collectionManager.getCollectionMetadata("gsdl3", "buildsequence");
-  }
-
-  public ClassifierManager getClassifierManager()
-  { return this.classifierManager;
-  }
-
-  public IndexerManager getIndexerManager()
-  { return this.indexerManager;
-  }
-
-  public void addIndexer(IndexerInterface iface)
-  { iface.configure(IndexerManager.outputDir, this.outputDir);
-    this.indexerManager.addIndexer(iface);
-  }
-
-  public void run()
-  { // Initialise collection manager - note start of build
-    this.collectionManager.startBuild();
-
-    // TODO: add expansion (e.g. Zip files)
-    
-    // Crawl the file tree - will recognise documents
-    for (int i = 0; i < this.inputRoots.size(); i ++)
-    { FileCrawler fileCrawler = new FileCrawler(new File((String) this.inputRoots.get(i)), recogniserManager);
-
-      fileCrawler.crawl();
+    public String getLastBuildSequence()
+    { 
+	return this.collectionManager.getCollectionMetadata("gsdl3", "buildsequence");
     }
 
-    // Extract phase, etc.
-    this.extractorManager.extractDocuments();
-    this.classifierManager.classifyDocuments();
-    this.indexerManager.indexDocuments();
+    public ClassifierManager getClassifierManager()
+    { 
+	return this.classifierManager;
+    }
 
-    // Timestamp management - update all timestamps on modified dates...
-    // 
-    // This should only occur at the end of building in case the build is cancelled...
-    docList.updateTimestamps(this.collectionManager.getBuildDate());
+    public IndexerManager getIndexerManager()
+    { 
+	return this.indexerManager;
+    }
 
-    // TODO: validation phase
+    public void addIndexer(IndexerInterface iface)
+    { 
+	iface.configure(IndexerManager.outputDir, this.outputDir);
+	this.indexerManager.addIndexer(iface);
+    }
 
-    if (this.archiveDir != null) {
-      this.docList.writeDocuments(new File(this.archiveDir));
-      //      this.docList.writeSQLDocuments(this.collectionManager.getDatabase());
+    public void run()
+    { 
+	// Initialise collection manager - note start of build
+	this.collectionManager.startBuild();
+
+	// TODO: add expansion (e.g. Zip files)
+    
+	// Crawl the file tree - will recognise documents
+	for (int i = 0; i < this.inputRoots.size(); i ++) {
+	    FileCrawler fileCrawler = new FileCrawler(new File((String) this.inputRoots.get(i)), recogniserManager);
+	    
+	    fileCrawler.crawl();
+	}
+
+	// Extract phase, etc.
+	this.extractorManager.extractDocuments();
+	this.classifierManager.classifyDocuments();
+	this.indexerManager.indexDocuments();
+
+	// Timestamp management - update all timestamps on modified dates...
+	// 
+	// This should only occur at the end of building in case the build is cancelled...
+	docList.updateTimestamps(this.collectionManager.getBuildDate());
+
+	// TODO: validation phase
+
+	if (this.archiveDir != null) {
+	    this.docList.writeDocuments(new File(this.archiveDir));
+	    //this.docList.writeSQLDocuments(this.collectionManager.getDatabase());
+	}
+    
+	this.collectionManager.setCollectionMetadata("gsdl3", "documentCount", Integer.toString(this.docList.getCount()));
+    
+	// TODO: write out collection configuration file (service lists, etc.)
+    
+	this.collectionManager.endBuild();
     }
-    
-    this.collectionManager.setCollectionMetadata("gsdl3", "documentCount", Integer.toString(this.docList.getCount()));
-    
-    // TODO: write out collection configuration file (service lists, etc.)
-    
-    this.collectionManager.endBuild();
-  }
   
-  public void addInputDirectory(String inputDir)
-  { this.inputRoots.add(inputDir);
-  }
+    public void addInputDirectory(String inputDir)
+    { 
+	this.inputRoots.add(inputDir);
+    }
 }
 
