Package java.io

Examples of java.io.FileFilter


    }
   

    public IFileInfo retrieveFile(final String id) throws IOException {

      FileFilter filter = new FileFilter() {
        public boolean accept(File file) {
          return file.getName().startsWith(id + ".");
        }
      };
     
View Full Code Here


    }   
   
    /**
     * Load the available stores in this repository
     */
    File[] files = basedir.listFiles(new FileFilter() {
       public boolean accept(File file) {
         return file.isDirectory();
       }
    });
   
View Full Code Here

    private void addDirLibs(File dir, List<URL> libs) throws MalformedURLException, IOException {
        if(!dir.exists() || !dir.isDirectory()) {
            return;
        }
        for (File jar : dir.listFiles(new FileFilter() {
            public boolean accept(File pathname) {
                return pathname.getName().toLowerCase().endsWith(".jar");
            }
        })) {
            libs.add(jar.getCanonicalFile().toURI().toURL());
View Full Code Here

        return fileNames.toArray(new String[fileNames.size()]);
    }

    private static Collection<String> getTestFiles(String location) {
        File locationDir = new File(location);
        File[] files = locationDir.listFiles(new FileFilter() {
            public boolean accept(File pathname) {
                return pathname.getName().toLowerCase().endsWith("-tests.xml");
            }
        });
View Full Code Here

    /*
     * @see TestCase#setUp()
     */
    protected void setUp() throws Exception {
        files = dir.listFiles(new FileFilter() {
            AudioFileFilter filter =new AudioFileFilter();
            public boolean accept(File pathname) {
                return pathname.isFile() && filter.accept(pathname);
            }
        });
View Full Code Here

    /* (non-Javadoc)
     * @see com.adito.vfs.VFSStore#getMountNames()
     */
    public Collection<String> getMountNames() throws Exception {
        File tempDownloadDirectory = new File(ContextHolder.getContext().getTempDirectory(), TempStore.TEMP_DOWNLOAD_MOUNT_NAME);
        File[] dirs = tempDownloadDirectory.listFiles(new FileFilter() {
      public boolean accept(File pathname) {
        return pathname.isDirectory();
      }
        });
        List<String> l = new ArrayList<String>();
View Full Code Here

    while (t.hasMoreTokens()) {
      try {
        String sf = t.nextToken();
        File[] f = null;
        if (sf.endsWith("/*.jar")) {
          f = new File(sf.substring(0, sf.length() - 6)).listFiles(new FileFilter() {
            public boolean accept(File pathname) {
              return pathname.getName().toLowerCase().endsWith(".jar");
            }
          });
        } else {
View Full Code Here

    StringTokenizer t = new StringTokenizer(extensionList, ",");
    while (t.hasMoreTokens()) {
      String ext = t.nextToken();
      if (ext.equalsIgnoreCase("all")) {
        File f = new File(SystemProperties.get("user.dir")).getParentFile();
        File[] dirs = f.listFiles(new FileFilter() {
          public boolean accept(File pathname) {
            File f = new File(pathname, "extensions");
            return f.exists() && f.isDirectory();
          }
        });
        for (int i = 0; dirs != null && i < dirs.length; i++) {
          devExtensions.add(dirs[i].getName());
        }
      } else if (ext.equalsIgnoreCase("enterprise")) {
        File f = new File(SystemProperties.get("user.dir")).getParentFile();
        File[] dirs = f.listFiles(new FileFilter() {
          public boolean accept(File pathname) {
            File f = new File(pathname, "extensions");
            return f.exists() && f.isDirectory() && pathname.getName().indexOf("adito-enterprise-") != -1;
          }
        });
        for (int i = 0; dirs != null && i < dirs.length; i++) {
          devExtensions.add(dirs[i].getName());
        }
      } else if (ext.equalsIgnoreCase("community")) {
        File f = new File(SystemProperties.get("user.dir")).getParentFile();
        File[] dirs = f.listFiles(new FileFilter() {
          public boolean accept(File pathname) {
            File f = new File(pathname, "extensions");
            return f.exists() && f.isDirectory() && pathname.getName().indexOf("adito-community-") != -1;
          }
        });
View Full Code Here

        } catch (MalformedURLException e) {
        }
      }
      File privateDir = new File(extensionDir, "private");
      if (privateDir.exists()) {
        File[] jars = privateDir.listFiles(new FileFilter() {
          public boolean accept(File pathname) {
            return pathname.getName().toLowerCase().endsWith(".jar");
          }
        });
        for (int idx = 0; jars != null && idx < jars.length; idx++) {
View Full Code Here

        if (log.isInfoEnabled())
          log.info("Notifier started");
    }

    void loadFromDisk() throws IOException {
        File[] f = queueDirectory.listFiles(new FileFilter() {
            public boolean accept(File f) {
                return f.getName().endsWith(".msg");
            }
        });
        // TODO better error handling in parsing of message files. Report on
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.