Package java.io

Examples of java.io.FileFilter


    final String base = f.getAbsolutePath();
    Disks.visitFile(f, new FileVisitor() {
      public void visit(File file) {
        list.add(new FileResource(base, file));
      }
    }, new FileFilter() {
      public boolean accept(File theFile) {
        if (ignoreHidden && theFile.isHidden())
          return false;
        if (theFile.isDirectory()) {
          String fnm = theFile.getName().toLowerCase();
View Full Code Here


  private void copyResourcesFromDirectory(File dir) throws IOException {
    if (!COPY_INPATH_DIR_RESOURCES) {
      return;
    }
    // Get a list of all files (i.e. everything that isnt a directory)
    File[] files = FileUtil.listFiles(dir, new FileFilter() {
      public boolean accept(File f) {
        boolean accept = !(f.isDirectory() || f.getName().endsWith(".class"));
        return accept;
      }
    });
View Full Code Here

  }

  void addFileOrPattern(File sourceFile) {
    if (sourceFile.getName().charAt(0) == '*') {
      if (sourceFile.getName().equals("*.java")) {
        addFiles(sourceFile.getParentFile(), new FileFilter() {
          public boolean accept(File f) {
            return f != null && f.getName().endsWith(".java");
          }
        });
      } else if (sourceFile.getName().equals("*.aj")) {
        addFiles(sourceFile.getParentFile(), new FileFilter() {
          public boolean accept(File f) {
            return f != null && f.getName().endsWith(".aj");
          }
        });
      } else {
View Full Code Here

  public void setInPath(List<File> dirsOrJars) {
    inPath = dirsOrJars;

    // remember all the class files in directories on the inpath
    binaryFiles = new ArrayList<BinarySourceFile>();
    FileFilter filter = new FileFilter() {
      public boolean accept(File pathname) {
        return pathname.getPath().endsWith(".class");
      }
    };
    for (Iterator<File> iter = dirsOrJars.iterator(); iter.hasNext();) {
View Full Code Here

            loader = null;
        }
    }
   
    private void scan(File dir, String packageName) throws ClassScannerException {
        File[] children = dir.listFiles(new FileFilter() {
            public boolean accept(File file) {
                return file.isDirectory() || (file.isFile() && file.getName().endsWith(".class"));
            }
        });
        for (File child : children) {
View Full Code Here

   * files are equally old, the file name with lower lexicographical value is
   * returned. If the directory is empty, this will return an absent option.
   */
  private Optional<FileInfo> getNextFile() {
    /* Filter to exclude finished or hidden files */
    FileFilter filter = new FileFilter() {
      public boolean accept(File pathName) {
        if ((pathName.getName().endsWith(completedSuffix)) ||
            (pathName.getName().startsWith("."))) {
          return false;
        }
View Full Code Here

    public static Set<File> getFiles(String table, final String cf)
    {
        Set<File> found = new HashSet<File>();
        for (String path : DatabaseDescriptor.getAllDataFileLocationsForTable(table))
        {
            File[] dbFiles = new File(path).listFiles(new FileFilter()
            {
                public boolean accept(File pathname)
                {
                    return pathname.getName().startsWith(cf + "-") && pathname.getName().endsWith(".db") && pathname.exists();
                }
View Full Code Here

      File f = stack.pop();
      push(f);
    }

    void push(File f) {
      push(f.listFiles(new FileFilter() {

        public boolean accept(File file) {
          return file.isDirectory();
        }
      }));
      push(f.listFiles(new FileFilter() {

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

        return arguments.toArray(new String[]{});
    }
   
    private File getFirstWsdlFile(File baseDir) throws IOException {
        LOG.debug("Looking for service wsdl file in " + baseDir.getAbsolutePath());
        File[] files = baseDir.listFiles(new FileFilter() {
            public boolean accept(File file) {
                return (file.isFile() && file.getName().endsWith(".wsdl"));
            }
        });
View Full Code Here

    CAS cas = ae.newCAS();
   
    // Create a file filter depending on the format
    // to filter out all file which do not have the
    // expected file ending
    FileFilter fileFilter;
    if (InputFormat.CAS.equals(inputFormat)) {
      fileFilter = new FileFilter() {
       
        public boolean accept(File file) {
          return file.getName().endsWith(".xmi") || file.getName().endsWith(".xcas") ||
                  (inputRecursive && file.isDirectory());
        }
      };
    }
    else if (InputFormat.PLAIN_TEXT.equals(inputFormat)) {
      fileFilter = new FileFilter() {
       
        public boolean accept(File file) {
          return file.getName().endsWith(".txt") || (inputRecursive && file.isDirectory());
        }
      };
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.