JAPI 0.9.0
Yet another Java API
API Documentation

net.sf.japi.util.filter.file
Class GlobFileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by net.sf.japi.util.filter.file.AbstractFileFilter
          extended by net.sf.japi.util.filter.file.RegexFileFilter
              extended by net.sf.japi.util.filter.file.GlobFileFilter
All Implemented Interfaces:
FileFilter, Filter<File>

public class GlobFileFilter
extends RegexFileFilter

A GlobFileFilter is a FileFilter which works like shell pattern matching. Currently supported are:

Author:
Christian Hujer
Notes:
Currently only matching file names, not directories is possible. Globs with '/' in it are likely to always fail on most operating systems.

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.sf.japi.util.filter.Filter
Filter.Factory
 
Constructor Summary
GlobFileFilter(String... globs)
          Create a GlobFileFilter.
 
Method Summary
static String[] createPatternsForGlobs(String... globs)
          Converts a shell glob expression into a regular expressions pattern.
 
Methods inherited from class net.sf.japi.util.filter.file.RegexFileFilter
accept, getDescription
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobFileFilter

public GlobFileFilter(String... globs)
Create a GlobFileFilter.

Parameters:
globs - Globs to match against.
Method Detail

createPatternsForGlobs

public static String[] createPatternsForGlobs(String... globs)
Converts a shell glob expression into a regular expressions pattern.

Parameters:
globs - shell glob expressions
Returns:
regular expressions matching the same filename as the shell glob

JAPI
Yet another Java API
API Documentation

© 2005-2006 Christian Hujer. All rights reserved. See copyright