Guava PatternFilenameFilter - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Guava PatternFilenameFilter class.

This code example shows how to use the following methods:
        return forkProcess(Main.class.getName(), debugPort, args);
    } 
 
    public static File findGradlewInRootDir() {
        File gradlewFile = null;
        if (new File(System.getProperty("user.dir")).listFiles(new PatternFilenameFilter("gradlew")).length == 1) {
            gradlewFile = new File(System.getProperty("user.dir") + File.separator + "gradlew");
        } else { 
            if (new File(System.getProperty("user.dir")).getParentFile().getParentFile()
                    .listFiles(new PatternFilenameFilter("gradlew")).length == 1) {
                gradlewFile = new File(new File(System.getProperty("user.dir")).getParentFile().getParentFile()
                        .getAbsolutePath()
                        + File.separator + "gradlew");
            } else { 
                Assert.fail("Cannot find gradlew executable in [" + System.getProperty("user.dir") + "] or ["
                        + new File(System.getProperty("user.dir")).getParentFile().getAbsolutePath() + "]");
            } 
        } 
        return gradlewFile;
    } 
5
CodeRank
This code example shows how to use the following methods:
public final class IOUtils { 
 
  /** 
   * A {@link FilenameFilter} that accepts files whose name does not start with "." 
   */ 
  public static final FilenameFilter NOT_HIDDEN = new PatternFilenameFilter("^[^.].*");
 
  private IOUtils() { 
  } 
 
  /** 
   * Attempts to recursively delete a directory. This may not work across symlinks. 
   * 
   * @param dir directory to delete along with contents 
   * @throws IOException if any deletion fails 
   */ 
  public static void deleteRecursively(File dir) throws IOException {
    if (dir == null || !dir.exists()) {
      return; 
    } 
3
CodeRank