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

        public CollectionSpecParser​(String rootDir,
                                    String regExp,
                                    Formatter errlog)
    • Method Detail

      • getRootDir

        public String getRootDir()
      • wantSubdirs

        public boolean wantSubdirs()
      • getFilter

        public com.google.re2j.Pattern getFilter()
      • getFilterOnName

        public boolean getFilterOnName()
      • getDateFormatMark

        public String getDateFormatMark()