org.rhq.plugins.augeas.helper
Class Glob

java.lang.Object
  extended by org.rhq.plugins.augeas.helper.Glob

public class Glob
extends java.lang.Object

A helper class for easy work with glob patterns.

Author:
Lukas Krejci

Method Summary
static void exclude(java.util.List<java.io.File> matches, java.lang.String globPattern)
           
static void excludeAll(java.util.List<java.io.File> matches, java.util.List<java.lang.String> globPatterns)
           
static void excludeAll(java.util.List<java.io.File> matches, java.lang.String... globPattern)
           
static boolean isWildcard(java.lang.String globPattern)
           
static java.util.List<java.io.File> match(java.io.File parentPath, java.lang.String globPattern)
          Returns a fixed size list of matches.
static java.util.List<java.io.File> matchAll(java.io.File parentPath, java.util.List<java.lang.String> globPatterns)
           
static java.util.List<java.io.File> matchAll(java.io.File parentPath, java.lang.String... globPattern)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isWildcard

public static boolean isWildcard(java.lang.String globPattern)

match

public static java.util.List<java.io.File> match(java.io.File parentPath,
                                                 java.lang.String globPattern)
Returns a fixed size list of matches. The parent path specifies the "root" from which the glob pattern applies. The glob pattern can span several directories with wildcards present only on the lowest level. The glob pattern is always relative to the specified parent path, even if it denotes an absolute path. In that case, the leading root path is chopped off and the rest is appended to the parent path.

Parameters:
parentPath - the parent path to start the pattern search
globPattern - the glob pattern to match against
Returns:
the list of matches

matchAll

public static java.util.List<java.io.File> matchAll(java.io.File parentPath,
                                                    java.lang.String... globPattern)

matchAll

public static java.util.List<java.io.File> matchAll(java.io.File parentPath,
                                                    java.util.List<java.lang.String> globPatterns)

exclude

public static void exclude(java.util.List<java.io.File> matches,
                           java.lang.String globPattern)

excludeAll

public static void excludeAll(java.util.List<java.io.File> matches,
                              java.lang.String... globPattern)

excludeAll

public static void excludeAll(java.util.List<java.io.File> matches,
                              java.util.List<java.lang.String> globPatterns)


Copyright © 2008-2009 Red Hat, Inc.. All Rights Reserved.