Package java.io

Examples of java.io.FileFilter


  private String findAcceptableJavaVersion() {
    try {
      String progDir = System.getenv("ProgramFiles");
   
      if(progDir != null) {
        File[] jres = new File(progDir,"Java").listFiles(new FileFilter() {
          public boolean accept(File pathname) {
            return pathname.getName().toLowerCase().indexOf("jre") != -1;
          }
        });
     
View Full Code Here


   * @return ���ض������ʼ�����
   * @throws IOException
   */
  public int read(Session ssn, List mails, List ident, int max_count) throws IOException{
    File fs = new File(path);
    File[] mailfiles = fs.listFiles(new FileFilter(){
      public boolean accept(File f) {
        if(f.length() > 0 && f.getName().endsWith(EML))
          return true;
        return false;
      }});
View Full Code Here

    public void xtestCreateCollection() throws DbException {
        DbCollection coll = DbCollection.getRootCollection();
        DbCollection xmark = coll.createCollection(COL_NAME);
        assert (xmark.getDirectory().exists());
        File collDir = coll.getDirectory();
        File[] matchFiles = collDir.listFiles(new FileFilter() {
            public boolean accept(File f) {
                return f.isDirectory() && COL_NAME.equals(f.getName());
            }
        });
        assert (matchFiles.length > 0);
View Full Code Here

    return filterArr.toArray(new ProgramFilter[filterArr.size()]);
  }

  private File[] getFilterFiles() {
    return mFilterDirectory.listFiles(new FileFilter() {
      public boolean accept(File f) {
        return f.getAbsolutePath().endsWith(".filter");
      }
    });
  }
View Full Code Here

     */
    public static File[] findAllFilesInDirectory(String dir) {

        // Find all files in the specified directory
        File modelsDirFile = new File(dir);
        FileFilter fileFilter = new FileFilter() {

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

      public static File[] findAllFilesInDirectoryHavingExtension(String dir, final String extension) {

        // Find all files in that directory that end in XML and attempt to
        // load them into the runtime metadata database.
        File modelsDirFile = new File(dir);
        FileFilter fileFilter = new FileFilter() {
            public boolean accept(File file) {
                if(file.isDirectory()) {
                    return false;
                }
View Full Code Here

    if (sTorrentFilePath != null && sTorrentFilenames == null) {
      File dir = new File(sTorrentFilePath);
      if (!dir.isDirectory())
        return 0;

      final File[] files = dir.listFiles(new FileFilter() {
        public boolean accept(File arg0) {
          if (FileUtil.getCanonicalFileName(arg0.getName()).endsWith(".torrent"))
            return true;
          if (FileUtil.getCanonicalFileName(arg0.getName()).endsWith(".tor"))
            return true;
View Full Code Here

      e.printStackTrace();
  }
  if (!modelsDirFile.exists()) {
      return null;
  }
  FileFilter fileFilter = new FileFilter() {

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

                  while (added_entry) {
                      f = f.getParentFile();
                      added_entry = files_to_move.add(f);
                  }
              }
        FileFilter ff = new FileFilter() {
          public boolean accept(File f) {return files_to_move.contains(f);}
        };
       
        if ( FileUtil.renameFile( old_file, new_save_location, false, ff )){
             
View Full Code Here

        File f = new File(args[0]);
        if (f.exists()) {
            if (f.isFile()) {
                ppm2Jpeg(f);
            } else {
                File[] list = f.listFiles(new FileFilter() {
                    public boolean accept(File pathname) {
                        return pathname.getName().endsWith(".ppm");
                    }
                });
                for (int i = 0; i < list.length; i++) {
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.