## org.das2.util.filesystem.Glob

known bug: *.java matches ".java". The unix glob behavior is to require that a leading . must be explicitly matched.

## Glob( )

## getGlobFileFilter

getGlobFileFilter( String glob ) → javax.swing.filechooser.FileFilter

### Parameters

glob - a String

### Returns:

javax.swing.filechooser.FileFilter
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getGlobFromRegex

getGlobFromRegex( String regex ) → String

converts regex into a glob, as best it can. This does not reverse all the conversions done by globToRegex.

### Parameters

regex - regular expression like "foo.\*\.dat"

### Returns:

a glob like "foo*.dat"
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getPattern

getPattern( String glob ) → java.util.regex.Pattern

converts a glob into a Pattern.

### Parameters

glob - a string like '*.dat'

### Returns:

a Pattern for the glob, for example *.dat -> .*\.dat
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getRegex

Deprecated: use globToRegex

## globToRegex

globToRegex( String glob ) → String

converts a glob into a regex. Rewritten by ChatGPT in 2026, now handles more complex examples like data.{cdf,nc}.

### Parameters

glob - a String

### Returns:

the regular expression that implements, like 'foo.*\.dat'
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## main

main( String[] args ) → void

### Parameters

args - a java.lang.String[]

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## unGlob

unGlob( org.das2.util.filesystem.FileSystem fs, String glob ) → org.das2.util.filesystem.FileObject[]

unglob the glob into an array of the matching FileObjects. See sftp://papco.org/home/jbf/ct/autoplot/script/demos/filesystem/unGlobDemo.jy

### Parameters

fs - the filesystem
glob - the glob, such as '/*.gif'

### Returns:

an array of FileObjects that match the glob.
[search for examples] [view on GitHub] [view on old javadoc] [view source]