Package thredds.inventory
Class CollectionSpecParser
- java.lang.Object
-
- thredds.inventory.CollectionSpecParserAbstract
-
- thredds.inventory.CollectionSpecParser
-
public class CollectionSpecParser extends CollectionSpecParserAbstract
Parses the collection specification string for local files.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"
-
-
Field Summary
-
Fields inherited from class thredds.inventory.CollectionSpecParserAbstract
dateFormatMark, delimiter, filter, filterOnName, fragment, rootDir, spec, subdirs
-
-
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 can't use any part of the dateFormat to filter on.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getFilePath(String filename)
Get the full path for a file-
Methods inherited from class thredds.inventory.CollectionSpecParserAbstract
getDateFormatMark, getDateFormatMark, getDelimiter, getFilter, getFilterAndDateMark, getFilterOnName, getFragment, getPathMatcher, getRegEx, getRootDir, getRootDir, splitOnLastDelimiter, toString, wantSubdirs
-
-
-
-
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 can't use any part of the dateFormat to filter on.- Parameters:
collectionSpec
- the collection specerrlog
- put error messages here, may be null
-
-
Method Detail
-
getFilePath
public String getFilePath(String filename)
Description copied from class:CollectionSpecParserAbstract
Get the full path for a file- Specified by:
getFilePath
in classCollectionSpecParserAbstract
- Parameters:
filename
- the file name- Returns:
- full file path
-
-