uk.co.lakesidetech.springxmldb.processor
Class XMLDBImportProcessor

java.lang.Object
  extended byuk.co.lakesidetech.springxmldb.processor.XMLDBImportProcessor
Direct Known Subclasses:
XMLDBAutoLoader

public class XMLDBImportProcessor
extends java.lang.Object

The XMLDBImportProcessor can be used to upload the contents of a filesystem to an XML database. The files are uploaded as either binary or XML files. Directories can be recursively uploaded creating collections for sub-directories on the way

TODO follow syb links, ignore certain file exentions ie CVS vss

Author:
Stuart Eccles

Constructor Summary
XMLDBImportProcessor()
           
 
Method Summary
 void setCollectionManageDao(ICollectionManageXMLDBDao collectionManageDao)
           
 void setXmldbManageDao(IResourceManageXMLDBDao xmldbManageDao)
           
 java.util.Map uploadDirectory(java.io.File directory, java.lang.String startingCollectionPath, boolean recursive)
          Upload a directory to an XML database collection uploading all files in that directory to the collection.
 java.lang.String uploadFile(java.io.File file, java.lang.String collectionPath)
          Upload a file from the filesystem to an XML database collection, creating the collection if it doesnt allready exist
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLDBImportProcessor

public XMLDBImportProcessor()
Method Detail

setCollectionManageDao

public void setCollectionManageDao(ICollectionManageXMLDBDao collectionManageDao)
Parameters:
collectionManageDao - The collectionManageDao to set.

setXmldbManageDao

public void setXmldbManageDao(IResourceManageXMLDBDao xmldbManageDao)
Parameters:
xmldbManageDao - The xmldbManageDao to set.

uploadFile

public java.lang.String uploadFile(java.io.File file,
                                   java.lang.String collectionPath)
Upload a file from the filesystem to an XML database collection, creating the collection if it doesnt allready exist

Parameters:
file - The file to uploaded
collectionPath - the collection path to upload it under
Returns:
The id of the resulting resource

uploadDirectory

public java.util.Map uploadDirectory(java.io.File directory,
                                     java.lang.String startingCollectionPath,
                                     boolean recursive)
Upload a directory to an XML database collection uploading all files in that directory to the collection. if the recursive flag is set create collections for a sub directories encountered and and upload the contents recursively

Parameters:
directory - the directory to start uploading from
startingCollectionPath - the collection path to start uploading to
recursive - to transverse directories and upload content
Returns:
A Map of collection paths to Sets of ids of resources uploaded