Package com.google.common.io

Examples of com.google.common.io.PatternFilenameFilter


        Sender sender = injector.getInstance(Sender.class);
        Receiver receiver = injector.getInstance(Receiver.class);

        // File[] s4rFiles = new File(appsDir).listFiles(new PatternFilenameFilter("\\w+\\.s4r"));
        File[] s4rFiles = new File(appsDir).listFiles(new PatternFilenameFilter(".+.s4r"));
        for (File s4rFile : s4rFiles) {
            logger.info("Loading app: " + s4rFile.getPath());
            loadApp(sender, receiver, s4rFile);
        }
View Full Code Here


   * @param baseDir the base dir
   * @return the list of all files ending with "js"
   */
  @Nonnull
  public static Collection<? extends File> listJsFiles( @Nonnull File baseDir ) {
    return ImmutableList.copyOf( baseDir.listFiles( new PatternFilenameFilter( ".*" + JS_SUFFIX ) ) );
  }
View Full Code Here

   * @param baseDir the base dir
   * @return the list of all files ending with "js"
   */
  @Nonnull
  public static Collection<? extends File> listJsFiles( @Nonnull File baseDir ) {
    return ImmutableList.copyOf( baseDir.listFiles( new PatternFilenameFilter( ".*" + JS_SUFFIX ) ) );
  }
View Full Code Here

  private FileUtils() {
    throw new AssertionError("not instantiable");
  }

  public static String backtrackToFile(String startDir, String targetFile) {
    FilenameFilter filenameFilter = new PatternFilenameFilter(targetFile);
    File currentDir = new File(startDir).getAbsoluteFile();

    while (currentDir.getParentFile() != null){
      String[] files = currentDir.list(filenameFilter);
      if (files.length == 1) {
View Full Code Here

   * @param baseDir the base dir
   * @return the list of all files ending with "js"
   */
  @Nonnull
  public static Collection<? extends File> listJsFiles( @Nonnull File baseDir ) {
    return ImmutableList.copyOf( baseDir.listFiles( new PatternFilenameFilter( ".*" + JS_SUFFIX ) ) );
  }
View Full Code Here

        return forked;
    }

    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 ["
View Full Code Here

   * @param baseDir the base dir
   * @return the list of all files ending with "js"
   */
  @Nonnull
  public static Collection<? extends File> listJsFiles( @Nonnull File baseDir ) {
    return ImmutableList.copyOf( baseDir.listFiles( new PatternFilenameFilter( ".*" + JS_SUFFIX ) ) );
  }
View Full Code Here

    private File pluginFile(File pluginsDir, ModuleDescriptor md) {
        return new File(pluginsDir, md.getModuleId() + ".plugin");
    }

    private File[] pluginFiles(File pluginsDir) {
        File[] files = pluginsDir.listFiles(new PatternFilenameFilter(".*\\.plugin"));
        return files == null ? new File[0] : files;
    }
View Full Code Here

TOP

Related Classes of com.google.common.io.PatternFilenameFilter

Copyright © 2018 www.massapicom. 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.