public static List<Path> expandGlobs(List<String> pathsWithGlobs, Configuration conf)
    throws IOException {

    List<Path> paths = Lists.newLinkedList();
    for (String pathStr : pathsWithGlobs) {
      Path path = new Path(pathStr);
      FileSystem fs = path.getFileSystem(conf);
      FileStatus[] statuses = fs.globStatus(path);
      // some versions of hadoop return null for non-existent paths
      if (statuses != null) {
        for (FileStatus status : statuses) {
          paths.add(status.getPath());
        }
      }
    }
    return paths;
  }
public static List<Path> expandGlobs(List<String> pathsWithGlobs, Configuration conf)
    throws IOException {

    List<Path> paths = Lists.newLinkedList();
    for (String pathStr : pathsWithGlobs) {
      Path path = new Path(pathStr);
      FileSystem fs = path.getFileSystem(conf);
      FileStatus[] statuses = fs.globStatus(path);
      
      if (statuses != null) {
        for (FileStatus status : statuses) {
          paths.add(status.getPath());
        }
      }
    }
    return paths;
  }
public static List < Path > expandGlobs ( List < String > pathsWithGlobs , Configuration conf ) throws IOException { List < Path > paths = Lists . newLinkedList ( ) ; for ( String pathStr : pathsWithGlobs ) { Path path = new Path ( pathStr ) ; FileSystem fs = path . getFileSystem ( conf ) ; FileStatus [ ] statuses = fs . globStatus ( path ) ; // some versions of hadoop return null for non-existent paths if ( statuses != null ) { for ( FileStatus status : statuses ) { paths . add ( status . getPath ( ) ) ; } } } return paths ; }
Given a list of paths that (potentially) have glob syntax in them,
return a list of paths with all the globs expanded.

@param pathsWithGlobs a list of paths that may or may not have glob syntax in them
@param conf job conf
@return an equivalent list of paths with no glob syntax in them
@throws IOException
Given a list of paths that ( potentially ) have glob syntax in them return a list of paths with all the globs expanded .