Class DirectoryCrawler
- All Implemented Interfaces:
DataProvider
This class handles data files recursively starting from a root directories tree. The organization of files in the directories is free. There may be sub-directories to any level. All sub-directories are browsed and all terminal files are checked for loading.
All registered
filters are applied.
Zip archives entries are supported recursively.
This is a simple application of the visitor design pattern for
directory hierarchy crawling.
- Author:
- Luc Maisonobe
- See Also:
-
Field Summary
Fields inherited from interface org.orekit.data.DataProvider
ZIP_ARCHIVE_PATTERN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanfeed(Pattern supported, DataLoader visitor, DataProvidersManager manager) Feed a data file loader by browsing the data collection.
-
Constructor Details
-
DirectoryCrawler
Build a data files crawler.- Parameters:
root- root of the directories tree (must be a directory)
-
-
Method Details
-
feed
Feed a data file loader by browsing the data collection.The method crawls all files referenced in the instance (for example all files in a directories tree) and for each file supported by the file loader it asks the file loader to load it.
If the method completes without exception, then the data loader is considered to have been fed successfully and the top level
data providers managerwill return immediately without attempting to use the next configured providers.If the method completes abruptly with an exception, then the top level
data providers managerwill try to use the next configured providers, in case another one can feed thedata loader.- Specified by:
feedin interfaceDataProvider- Parameters:
supported- pattern for file names supported by the visitorvisitor- data file visitor to usemanager- with the filters to apply to the resources.- Returns:
- true if some data has been loaded
-