Class 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"
    • 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 spec
        errlog - put error messages here, may be null
      • CollectionSpecParser

        public CollectionSpecParser​(String rootDir,
                                    String regExp,
                                    Formatter errlog)
        Parameters:
        rootDir - the root directory
        regExp - the regular expression to use as a filter
        errlog - put error messages here, may be null