Package org.apache.commons.io.filefilter

Examples of org.apache.commons.io.filefilter.WildcardFileFilter


     
      File subDir3 = new File(subDir2, "subdir3");
      subDir3.mkdir();
     
      Collection<File> files = FileUtils.listFilesAndDirs(subDir1,
                new WildcardFileFilter("*.*"), new WildcardFileFilter("*"));
     
      assertEquals(4, files.size());
      assertTrue("Should contain the directory.", files.contains(subDir1));
      assertTrue("Should contain the directory.", files.contains(subDir2));
      assertTrue("Should contain the file.", files.contains(someFile));
View Full Code Here


            File theFile = new File(subDir, fileNames[i]);
            createFile(theFile, fileSizes[i]);
        }

        Iterator<File> files = FileUtils.iterateFiles(subDir,
                                                new WildcardFileFilter("*.*"),
                                                new WildcardFileFilter("*"));

        Map<String, String> foundFileNames = new HashMap<String, String>();

        while (files.hasNext()) {
            boolean found = false;
View Full Code Here

     
      Collection<File> filesAndDirs = Arrays.asList(subDir1, subDir2, someFile, subDir3);
     
      int filesCount = 0;
      Iterator<File> files = FileUtils.iterateFilesAndDirs(subDir1,
                                                new WildcardFileFilter("*.*"),
                                                new WildcardFileFilter("*"));
        while (files.hasNext()) {
            filesCount++;
            File file = files.next();
            assertTrue("Should contain the directory/file", filesAndDirs.contains(file));
        }
View Full Code Here

            }

            if (cl.hasOption(EXCLUDE_CLI)) {
                String[] excludes = cl.getOptionValues(EXCLUDE_CLI);
                if (excludes != null) {
                    final FilenameFilter filter = new NotFileFilter(new WildcardFileFilter(excludes));
                    report.setInputFileFilter(filter);
                }
            }

            if (cl.hasOption('x')) {
View Full Code Here

                    MessageFactory.createStaticMessage(
                            String.format("Application directory does not exist: '%s'", appDir)));
        }
        // list mule-deploy.* files
        @SuppressWarnings("unchecked")
        Collection<File> deployFiles = FileUtils.listFiles(appDir, new WildcardFileFilter("mule-deploy.*"), null);
        if (deployFiles.size() > 1)
        {
            // TODO need some kind of an InvalidAppFormatException
            throw new MuleRuntimeException(
                    MessageFactory.createStaticMessage(
View Full Code Here

        String wildcard = "*.jar";
        if ( filters != null ) {
            wildcard = "*" + filters + "*.jar";
        }
        Collection<File> files = FileUtils.listFiles( new File( M2_REPO_DIR ),
                                                      new WildcardFileFilter( wildcard,
                                                                              IOCase.INSENSITIVE ),
                                                      DirectoryFileFilter.DIRECTORY );

        return files;
    }
View Full Code Here

     * Returns the list of files that should be processed for a given directory.
     * Currently ignores hidden directories.
     * @return IOFileFilter font directory filter
     */
    public static FilenameFilter getDefaultFilter() {
        return new WildcardFileFilter(ConfigGenerator.FONT_FILE_EXTENSIONS,
                IOCase.INSENSITIVE);
    }
View Full Code Here

            }

            if (cl.hasOption(EXCLUDE_CLI)) {
                String[] excludes = cl.getOptionValues(EXCLUDE_CLI);
                if (excludes != null) {
                    final FilenameFilter filter = new NotFileFilter(new WildcardFileFilter(excludes));
                    report.setInputFileFilter(filter);
                }
            }
            else if (cl.hasOption(EXCLUDE_FILE_CLI)) {
                String excludeFileName = cl.getOptionValue(EXCLUDE_FILE_CLI);
View Full Code Here

  public SendLogToChainsaw(String directory, String fileNameFilter, String host, int port, Date start, Date end, String regex, String level) throws Exception {

    // Set up the file name filter
    if (null != fileNameFilter) {
      fileFilter = new WildcardFileFilter(fileNameFilter);
    } else {
      fileFilter = new WildcardFileFilter("*");
    }

    // Get the list of files that match
    File dir = new File(directory);
    if (dir.isDirectory()) {
View Full Code Here

                : "WARN";
    }

    private String[] buildKarafClasspath(File karafHome) {
        List<String> cp = new ArrayList<String>();
        File[] jars = new File(karafHome + "/lib").listFiles((FileFilter) new WildcardFileFilter("*.jar"));
        for (File jar : jars) {
            cp.add(jar.toString());
        }
        return cp.toArray(new String[]{});
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.io.filefilter.WildcardFileFilter

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.