Class GlobExpander

java.lang.Object
org.apache.hadoop.fs.GlobExpander

@Private @Unstable public class GlobExpander extends Object
  • Constructor Details

    • GlobExpander

      public GlobExpander()
  • Method Details

    • expand

      public static List<String> expand(String filePattern) throws IOException
      Expand globs in the given filePattern into a collection of file patterns so that in the expanded set no file pattern has a slash character ("/") in a curly bracket pair.

      Some examples of how the filePattern is expanded:

       
       filePattern         - Expanded file pattern 
       {a/b}               - a/b
       /}{a/b}             - /}a/b
       p{a/b,c/d}s         - pa/bs, pc/ds
       {a/b,c/d,{e,f}}     - a/b, c/d, {e,f}
       {a/b,c/d}{e,f}      - a/b{e,f}, c/d{e,f}
       {a,b}/{b,{c/d,e/f}} - {a,b}/b, {a,b}/c/d, {a,b}/e/f
       {a,b}/{c/\d}        - {a,b}/c/d
       
      Parameters:
      filePattern - file pattern.
      Returns:
      expanded file patterns
      Throws:
      IOException - raised on errors performing I/O.