Package thredds.inventory
Class CollectionSpecParser
- java.lang.Object
-
- thredds.inventory.CollectionSpecParser
-
@ThreadSafe public class CollectionSpecParser extends Object
Parses the collection specification string.the idea is that one copies the full path of an example dataset, then edits it
Example: "/data/ldm/pub/native/grid/NCEP/GFS/Alaska_191km/** /GFS_Alaska_191km_#yyyyMMdd_HHmm#\.grib1$"
- rootDir ="/data/ldm/pub/native/grid/NCEP/GFS/Alaska_191km"/
- subdirs=true (because ** is present)
- dateFormatMark="GFS_Alaska_191km_#yyyyMMdd_HHmm"
- regExp='GFS_Alaska_191km_.............\.grib1$
Example: "Q:/grid/grib/grib1/data/agg/.*\.grb"
- rootDir ="Q:/grid/grib/grib1/data/agg/"/
- subdirs=false
- dateFormatMark=null
- useName=yes
- regexp= ".*\.grb" (anything ending with .grb)
- Since:
- Jul 7, 2009
- See Also:
- "https://www.unidata.ucar.edu/projects/THREDDS/tech/tds4.2/reference/collections/CollectionSpecification.html"
-
-
Constructor Summary
Constructors Constructor Description CollectionSpecParser(String rootDir, String regExp, Formatter errlog)CollectionSpecParser(String collectionSpec, Formatter errlog)Single spec : "/topdir/** /#dateFormatMark#regExp" This only allows the dateFormatMark to be in the file name, not anywhere else in the filename path, and you cant use any part of the dateFormat to filter on.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDateFormatMark()com.google.re2j.PatterngetFilter()booleangetFilterOnName()PathMatchergetPathMatcher()StringgetRootDir()StringtoString()booleanwantSubdirs()
-
-
-
Constructor Detail
-
CollectionSpecParser
public CollectionSpecParser(String collectionSpec, Formatter errlog)
Single spec : "/topdir/** /#dateFormatMark#regExp" This only allows the dateFormatMark to be in the file name, not anywhere else in the filename path, and you cant use any part of the dateFormat to filter on.- Parameters:
collectionSpec- the collection Specerrlog- put error messages here, may be null
-
-
Method Detail
-
getPathMatcher
public PathMatcher getPathMatcher()
-
getRootDir
public String getRootDir()
-
wantSubdirs
public boolean wantSubdirs()
-
getFilter
public com.google.re2j.Pattern getFilter()
-
getFilterOnName
public boolean getFilterOnName()
-
getDateFormatMark
public String getDateFormatMark()
-
-