Package thredds.core
Class DataRootManager
- java.lang.Object
-
- thredds.core.DataRootManager
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
@Component public class DataRootManager extends Object implements org.springframework.beans.factory.InitializingBean
The DataRootHandler manages all the "data roots" for a TDS and provides mappings from URLs to catalog and datasets.The "data roots" are read in from one or more trees of config catalogs and are defined by the datasetScan and datasetRoot and featureCollection elements in the config catalogs.
- Since:
- 1/23/2015
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDataRootManager.DataRootMatch
-
Field Summary
Fields Modifier and Type Field Description static booleandebug
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()DataRootManager.DataRootMatchfindDataRootMatch(String spath)thredds.server.catalog.FeatureCollectionReffindFeatureCollection(String collectionName)List<thredds.server.catalog.FeatureCollectionRef>getFeatureCollections()static DataRootManagergetInstance()StringgetLocationFromRequestPath(String reqPath)Return the location to which the given path maps.voidmakeDebugActions()voidsetDataRootLocationAliasExpanders(Map<String,String> aliases)voidsetDataRootPathMatcher(thredds.server.catalog.DataRootPathMatcher dataRootPathMatcher)voidshowRoots(Formatter f)
-
-
-
Field Detail
-
debug
public static final boolean debug
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static DataRootManager getInstance()
-
setDataRootLocationAliasExpanders
public void setDataRootLocationAliasExpanders(Map<String,String> aliases)
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
setDataRootPathMatcher
public void setDataRootPathMatcher(thredds.server.catalog.DataRootPathMatcher dataRootPathMatcher)
-
findDataRootMatch
public DataRootManager.DataRootMatch findDataRootMatch(String spath)
-
getLocationFromRequestPath
public String getLocationFromRequestPath(String reqPath)
Return the location to which the given path maps. Null is returned if the dataset does not exist, the matching DatasetScan or DataRoot filters out the requested MFile, the MFile does not represent a File (i.e., it is not a CrawlableDatasetFile), or an I/O error occurs- Parameters:
reqPath- the request path.- Returns:
- the location of the file on disk, or null
- Throws:
IllegalStateException- if the request is not for a descendant of (or the same as) the matching DatasetRoot collection location.
-
showRoots
public void showRoots(Formatter f)
-
getFeatureCollections
public List<thredds.server.catalog.FeatureCollectionRef> getFeatureCollections()
-
findFeatureCollection
public thredds.server.catalog.FeatureCollectionRef findFeatureCollection(String collectionName)
-
makeDebugActions
public void makeDebugActions()
-
-