lucee.Componentcommandbox.system.modules.globber.models.Globber
Copyright Since 2014 by Ortus Solutions, Corp www.coldbox.org | www.ortussolutions.com I represent a single globbing pattern and provide a fluent API to access the matching files Unlike the PathPatternMatcher, which only handles comparisons of patterns, this model actually interacts with the file system to resolve a pattern to a list of real file system resources.
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
baseDir
Directory the list was pulled from.
|
true
|
false
|
|
any
|
excludePattern
The file globbing pattern NOT to match.
|
true
|
false
|
|
any
|
format
Return matches as a query instead of an array.
|
array
|
true
|
false
|
any
|
matchQuery
query of real file system resources that match the pattern.
|
true
|
false
|
|
any
|
pathPatternMatcher
|
true
|
false
|
|
any
|
pattern
The file globbing pattern to match.
|
true
|
false
|
|
any
|
sort
Sort to use.
|
type, name
|
true
|
false
|
Constructor Summary | |
---|---|
init()
|
Method Summary | |
---|---|
any
|
addExcludePattern(string excludePattern)
Add addiional excludePattern to process. |
any
|
addPattern(string pattern)
Add addiional pattern to process. |
any
|
apply([any udf])
Pass a closure to this function to have it. |
any
|
asArray()
Return results as array. |
any
|
asQuery()
Return results as query. |
any
|
count()
Get count of matched files. |
private any
|
ensureMatches()
Make sure the MatchQuery has been loaded. |
string
|
getBaseDir()
|
any
|
getCleanSort()
The sort function in CFDirectory will simply ignore invalid sort columns so I'm mimicing that here, as much as I dislike it. |
any
|
getExcludePattern()
Always returns a string which is a list of excludePatterns. |
any
|
getExcludePatternArray()
|
string
|
getFormat()
|
string
|
getMatchQuery()
|
string
|
getPathPatternMatcher()
|
any
|
getPattern()
Always returns a string which is a list of patterns. |
any
|
getPatternArray()
|
string
|
getSort()
|
any
|
matches()
Get array of matched file system paths. |
private any
|
process()
Load matching file from the file system. |
private any
|
processPattern([string pattern])
|
any
|
setBaseDir(any baseDir)
|
any
|
setExcludePattern(any excludePattern)
Can be list of excludePatterns or array of excludePatterns. |
any
|
setFormat(any format)
|
any
|
setMatchQuery(any matchQuery)
|
any
|
setPathPatternMatcher(any pathPatternMatcher)
|
any
|
setPattern(any pattern)
Override setter to ensure consistent slashe in pattern. |
any
|
setSort(any sort)
|
any
|
withSort([any thisSort])
Return results as array. |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Property Detail |
---|
Directory the list was pulled from
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe file globbing pattern NOT to match.
access
- publicrequired
- falsereturntype
- anyserializable
- trueReturn matches as a query instead of an array
access
- publicrequired
- falsereturntype
- anyserializable
- truequery of real file system resources that match the pattern
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- pathPatternMatcher@globberserializable
- trueThe file globbing pattern to match.
access
- publicrequired
- falsereturntype
- anyserializable
- trueSort to use
access
- publicrequired
- falsereturntype
- anyserializable
- trueMethod Detail |
---|
Add addiional excludePattern to process
excludePattern
Add addiional pattern to process
pattern
Pass a closure to this function to have it applied to each paths matched by the pattern.
udf
Return results as array
Return results as query
Get count of matched files
Make sure the MatchQuery has been loaded.
The sort function in CFDirectory will simply ignore invalid sort columns so I'm mimicing that here, as much as I dislike it. The sort should be in the format of "col asc, col2 desc, col3, col4" like a SQL order by If any of the coluns or sort directions don't look right, just bail and return the default sort.
Always returns a string which is a list of excludePatterns
Always returns a string which is a list of patterns
Get array of matched file system paths
Load matching file from the file system
pattern
baseDir
Can be list of excludePatterns or array of excludePatterns. Empty excludePatterns will be ignored
excludePattern
format
matchQuery
pathPatternMatcher
Override setter to ensure consistent slashe in pattern Can be list of patterns or array of patterns. Empty patterns will be ignored
pattern
sort
Return results as array
thisSort