Package thredds.inventory
Class CollectionSpecParserAbstract
- java.lang.Object
-
- thredds.inventory.CollectionSpecParserAbstract
-
- Direct Known Subclasses:
CollectionSpecParser
,CollectionSpecParserS3
@ThreadSafe public abstract class CollectionSpecParserAbstract extends Object
Abstract base class for parsing collection specification strings
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CollectionSpecParserAbstract(String collectionSpec, String rootDir, String filterAndDateMark, String delimiter, String fragment, 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.protected
CollectionSpecParserAbstract(String rootDir, String regExp, String delimiter, String fragment, Formatter errlog)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
getDateFormatMark()
protected static String
getDateFormatMark(String filterAndDateMark)
String
getDelimiter()
abstract String
getFilePath(String filename)
Get the full path for a filecom.google.re2j.Pattern
getFilter()
protected static String
getFilterAndDateMark(String collectionSpec, String delimiter)
boolean
getFilterOnName()
String
getFragment()
PathMatcher
getPathMatcher()
protected static com.google.re2j.Pattern
getRegEx(String filterAndDateMark)
String
getRootDir()
protected static String
getRootDir(String collectionSpec, String defaultRootDir, String delimiter)
protected static String[]
splitOnLastDelimiter(String collectionSpec, String delimiter)
String
toString()
boolean
wantSubdirs()
-
-
-
Field Detail
-
spec
protected final String spec
-
rootDir
protected final String rootDir
-
subdirs
protected final boolean subdirs
-
filterOnName
protected final boolean filterOnName
-
filter
protected final com.google.re2j.Pattern filter
-
dateFormatMark
protected final String dateFormatMark
-
delimiter
protected final String delimiter
-
fragment
protected final String fragment
-
-
Constructor Detail
-
CollectionSpecParserAbstract
protected CollectionSpecParserAbstract(String collectionSpec, String rootDir, String filterAndDateMark, String delimiter, String fragment, 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 specrootDir
- the root directoryfilterAndDateMark
- the part of spec containing filter and/ or date markdelimiter
- the delimiter in the file pathfragment
- in patherrlog
- put error messages here, may be null
-
CollectionSpecParserAbstract
protected CollectionSpecParserAbstract(String rootDir, String regExp, String delimiter, String fragment, Formatter errlog)
- Parameters:
rootDir
- the root directoryregExp
- the regular expression to use as a filterdelimiter
- the delimiter in the file pathfragment
- in patherrlog
- put error messages here, may be null
-
-
Method Detail
-
getRootDir
protected static String getRootDir(String collectionSpec, String defaultRootDir, String delimiter)
-
getFilterAndDateMark
protected static String getFilterAndDateMark(String collectionSpec, String delimiter)
-
splitOnLastDelimiter
protected static String[] splitOnLastDelimiter(String collectionSpec, String delimiter)
-
getRegEx
protected static com.google.re2j.Pattern getRegEx(String filterAndDateMark)
-
getPathMatcher
public PathMatcher getPathMatcher()
-
getRootDir
public String getRootDir()
-
getFilePath
public abstract String getFilePath(String filename)
Get the full path for a file- Parameters:
filename
- the file name- Returns:
- full file path
-
getDelimiter
public String getDelimiter()
-
getFragment
public String getFragment()
-
wantSubdirs
public boolean wantSubdirs()
-
getFilter
public com.google.re2j.Pattern getFilter()
-
getFilterOnName
public boolean getFilterOnName()
-
getDateFormatMark
public String getDateFormatMark()
-
-