de.pangaea.metadataportal.harvester
Class DirectoryHarvester
java.lang.Object
de.pangaea.metadataportal.harvester.Harvester
de.pangaea.metadataportal.harvester.SingleFileEntitiesHarvester
de.pangaea.metadataportal.harvester.DirectoryHarvester
- All Implemented Interfaces:
- FilenameFilter
public class DirectoryHarvester
- extends SingleFileEntitiesHarvester
- implements FilenameFilter
Harvester for traversing file system directories. Identifiers are build from the relative path of files against the base directory.
This harvester supports the following additional harvester properties:
directory: file system directory to harvest
recursive: traverse in subdirs (default: false)
identifierPrefix: This prefix is appended before all relative file system pathes (that are the identifiers of the documents) (default: "")
filenameFilter: regex to match the filename (default: none)
- Author:
- Uwe Schindler
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DirectoryHarvester
public DirectoryHarvester()
open
public void open(SingleIndexConfig iconfig)
throws Exception
- Description copied from class:
Harvester
- Opens harvester for harvesting documents into the index described by the given
SingleIndexConfig.
Opens Harvester.index for usage in Harvester.harvest() method.
- Overrides:
open in class SingleFileEntitiesHarvester
- Throws:
Exception - if an exception occurs during opening (various types of exceptions can be thrown).
harvest
public void harvest()
throws Exception
- Description copied from class:
Harvester
- This method is called by the harvester after
Harvester.open(de.pangaea.metadataportal.config.SingleIndexConfig)'ing it. Overwrite this
method in your harvester class.
This method should harvest files from somewhere, generate MetadataDocuments and add
them with Harvester.addDocument(de.pangaea.metadataportal.harvester.MetadataDocument).
- Specified by:
harvest in class Harvester
- Throws:
Exception - of any type.
enumerateValidHarvesterPropertyNames
protected void enumerateValidHarvesterPropertyNames(Set<String> props)
- Description copied from class:
Harvester
- This method is used by subclasses to enumerate all available harvester properties that are implemented by them.
Overwrite this method in your own implementation and append all harvester names to the supplied
Set.
The public API for client code requesting property names is Harvester.getValidHarvesterPropertyNames().
- Overrides:
enumerateValidHarvesterPropertyNames in class SingleFileEntitiesHarvester
- See Also:
Harvester.getValidHarvesterPropertyNames()
accept
public boolean accept(File dir,
String name)
- Specified by:
accept in interface FilenameFilter
Copyright ©2007-2011 panFMP Developers c/o Uwe Schindler