Examples of GlobFilter


Examples of org.apache.hadoop.fs.FileSystem.GlobFilter

    String[] patternComponents = pattern.toUri().getPath().split(Path.SEPARATOR);
    if (pathComponents.length < patternComponents.length) {
      return false;
    }
    for (int i = 0; i < patternComponents.length; i++) {
      GlobFilter fp = new GlobFilter(patternComponents[i], null);
      if (!fp.hasPattern()) {
        if (!patternComponents[i].equals(pathComponents[i])) {
          return false;
        }
      } else {
        if (!fp.accept(pathComponents[i])) {
          return false;
        }
      }
    }
    return true;
View Full Code Here

Examples of org.apache.hadoop.fs.GlobFilter

      throw new FileNotFoundException("Source dir not found " + srcDirPath);
    }
    if (!srcFS.isDirectory(srcDirPath)) {
      throw new FileNotFoundException("Source dir not a directory " + srcDirPath);
    }
    GlobFilter dotFilter = new GlobFilter("[!.]*");
    FileStatus[] entries = srcFS.listStatus(srcDirPath, dotFilter);
    int srcFileCount = entries.length;
    if (srcFileCount == 0) {
      return 0;
    }
View Full Code Here

Examples of org.apache.hadoop.fs.GlobFilter

     *
     * @throws IOException thrown if the filter expression is incorrect.
     */
    public FSListStatus(String path, String filter) throws IOException {
      this.path = new Path(path);
      this.filter = (filter == null) ? this : new GlobFilter(filter);
    }
View Full Code Here

Examples of org.apache.hadoop.fs.GlobFilter

     *
     * @throws IOException thrown if the filter expression is incorrect.
     */
    public FSListStatus(String path, String filter) throws IOException {
      this.path = new Path(path);
      this.filter = (filter == null) ? this : new GlobFilter(filter);
    }
View Full Code Here

Examples of org.apache.hadoop.fs.GlobFilter

     *
     * @throws IOException thrown if the filter expression is incorrect.
     */
    public FSListStatus(String path, String filter) throws IOException {
      this.path = new Path(path);
      this.filter = (filter == null) ? this : new GlobFilter(filter);
    }
View Full Code Here

Examples of org.apache.hadoop.fs.GlobFilter

      throw new FileNotFoundException("Source dir not found " + srcDirPath);
    }
    if (!srcFS.isDirectory(srcDirPath)) {
      throw new FileNotFoundException("Source dir not a directory " + srcDirPath);
    }
    GlobFilter dotFilter = new GlobFilter("[!.]*");
    FileStatus[] entries = srcFS.listStatus(srcDirPath, dotFilter);
    int srcFileCount = entries.length;
    if (srcFileCount == 0) {
      return 0;
    }
View Full Code Here

Examples of org.apache.hadoop.fs.GlobFilter

      fs.mkdirs(dir);
    } else if (!fs.isDirectory(dir)) {
      throw new FileNotFoundException("Not a directory " + dir.toString());
    }
   
    PathFilter filter = new GlobFilter(SliderKeys.HISTORY_FILENAME_GLOB_PATTERN);
    FileStatus[] stats = fs.listStatus(dir, filter);
    List<Path> paths = new ArrayList<>(stats.length);
    for (FileStatus stat : stats) {
      log.debug("Possible entry: {}", stat.toString());
      if (stat.isFile() && (includeEmptyFiles || stat.getLen() > 0)) {
View Full Code Here

Examples of org.apache.hadoop.fs.GlobFilter

     *
     * @throws IOException thrown if the filter expression is incorrect.
     */
    public FSListStatus(String path, String filter) throws IOException {
      this.path = new Path(path);
      this.filter = (filter == null) ? this : new GlobFilter(filter);
    }
View Full Code Here

Examples of org.apache.hadoop.fs.GlobFilter

     *
     * @throws IOException thrown if the filter expression is incorrect.
     */
    public FSListStatus(String path, String filter) throws IOException {
      this.path = new Path(path);
      this.filter = (filter == null) ? this : new GlobFilter(filter);
    }
View Full Code Here

Examples of org.apache.hadoop.fs.GlobFilter

     *
     * @throws IOException thrown if the filter expression is incorrect.
     */
    public FSListStatus(String path, String filter) throws IOException {
      this.path = new Path(path);
      this.filter = (filter == null) ? this : new GlobFilter(filter);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.