Package java.io

Examples of java.io.FileFilter


  /** Test the parsing of example scripts **/
  public void testParseExamples() throws Exception {
    // hackedy-hack-hack
    boolean foundFiles = false;
    final File examplesDir = new File(ConfLoader.class.getResource(".").toURI());
    for (File algFile : examplesDir.listFiles(new FileFilter() {
      @Override
      public boolean accept(File pathname) { return pathname.isFile() && pathname.getName().endsWith(".alg"); }
    })) {
      try {
        Config config = new Config(new InputStreamReader(new FileInputStream(algFile), "UTF-8"));
View Full Code Here


        return builtAny;
    }

    private Set<File> findJarsInTarget() throws Exception {
        File targetDir = model.getTarget();
        File[] targetJars = targetDir.listFiles(new FileFilter() {
            @Override
            public boolean accept(File pathname) {
                return pathname.getName().toLowerCase().endsWith(".jar");
            }
        });
View Full Code Here

        return builtAny;
    }

    private Set<File> findJarsInTarget() throws Exception {
        File targetDir = model.getTarget();
        File[] targetJars = targetDir.listFiles(new FileFilter() {
            public boolean accept(File pathname) {
                return pathname.getName().toLowerCase().endsWith(".jar");
            }
        });
        Set<File> result = new HashSet<File>();
View Full Code Here

        }

        // add all of the libs
        File libDir = new File(webInfDir, "lib");
        if (libDir.isDirectory()) {
            File[] libs = libDir.listFiles(new FileFilter() {
                public boolean accept(File file) {
                    return file.isFile() && file.getName().endsWith(".jar");
                }
            });
View Full Code Here

        return levels.iterator();
    }
   
    private Iterator<String> handleConfigPath() {
        if (getConfigDirectory().exists() && getConfigDirectory().isDirectory()) {
            File[] configFiles = getConfigDirectory().listFiles(new FileFilter() {

                public boolean accept(File file) {
                    return file.isFile();
                }
            });
View Full Code Here

     */
    protected void copyDirectory(final File source, final File target, final String[] includes, final String[] excludes)
    throws IOException {
        final String prefix = source.getAbsolutePath() + File.separatorChar;
        final int prefixLength = prefix.length();
        org.apache.commons.io.FileUtils.copyDirectory(source, target, new FileFilter() {

            public boolean accept(final File file) {
                final String path = file.getAbsolutePath().substring(prefixLength).replace(File.separatorChar, '/');
                if ( includes != null ) {
                    boolean matched = false;
View Full Code Here

            }
        }
    }

    public static FileFilter endsWith(final String suffix) {
        return new FileFilter() {

            public boolean accept(File file) {
                return file.getName().endsWith(suffix);
            }
        };
View Full Code Here

            }
        }
    }

    public static FileFilter endsWith(final String suffix) {
        return new FileFilter() {

            public boolean accept(File file) {
                return file.getName().endsWith(suffix);
            }
        };
View Full Code Here

      f.delete();
    }
  }

  public void extract() {
    File[] sgmFiles = reutersDir.listFiles(new FileFilter() {
      @Override
      public boolean accept(File file) {
        return file.getName().endsWith(".sgm");
      }
    });
View Full Code Here

    if (consumeOrder != ConsumeOrder.RANDOM ||
      candidateFileIter == null ||
      !candidateFileIter.hasNext()) {
      /* Filter to exclude finished or hidden files */
      FileFilter filter = new FileFilter() {
        public boolean accept(File candidate) {
          String fileName = candidate.getName();
          if ((candidate.isDirectory()) ||
            (fileName.endsWith(completedSuffix)) ||
            (fileName.startsWith(".")) ||
View Full Code Here

TOP

Related Classes of java.io.FileFilter

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.