Package java.io

Examples of java.io.FileFilter


    public void clearAllMessages() {
        synchronized (messages) {
            try {
                messages.clear();
                File[] f = queueDirectory.listFiles(new FileFilter() {
                    public boolean accept(File f) {
                        return f.getName().endsWith(".msg");
                    }
                });
                if (f != null) {
View Full Code Here


    }
   

    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

        if (!file.exists() || !file.isDirectory()) {
            logger.info("Parameter is not a directory: {}", folder);
            return list;
        }

        File[] fileArray = file.listFiles(new FileFilter() {

            public boolean accept(File pathname) {
                if (pathname.isDirectory() || pathname.getName().endsWith(".class")) {
                    return true;
                }
View Full Code Here

      File tempUploadDir = new File(WebappHelper.getUserDataRoot() + "/tmp/");
      long counter = 0;
      long mem = 0;
      if (tempUploadDir.exists() && tempUploadDir.isDirectory()) {
        // get all files that start with instanceID_NodeID_ followed by a number
        FileFilter tmpUploadFileFilter = new RegexFileFilter(WebappHelper.getInstanceId()+ "_" + CoordinatorManager.getCoordinator().getNodeId() + "_[0-9]*");
        File[] tmpUploadFiles = tempUploadDir.listFiles(tmpUploadFileFilter);
        for (File file : tmpUploadFiles) {
          if (file.isFile() && file.exists()) {
            mem += file.length();
            file.delete();
View Full Code Here

  
    File [] languageLibrariesPluginFolders = getLanguageLibrariesPluginFolders();
    if (languageLibrariesPluginFolders != null) {
      for (File languageLibrariesPluginFolder : languageLibrariesPluginFolders) {
        // Try to load sh3l files from language plugin folder
        File [] pluginLanguageLibraryFiles = languageLibrariesPluginFolder.listFiles(new FileFilter () {
          public boolean accept(File pathname) {
            return pathname.isFile();
          }
        });
       
View Full Code Here

      applicationFolder = getPreferencesFolder();
    } catch (IOException ex) {
      throw new RecorderException("Can't access to application folder");
    }
    File [] obsoleteContentFiles = applicationFolder.listFiles(
        new FileFilter() {
          public boolean accept(File applicationFile) {
            try {
              URL toURL = applicationFile.toURI().toURL();
              return applicationFile.getName().startsWith(contentPrefix)
                 && !contentURLs.contains(toURL);
View Full Code Here

    catch (Exception ex)
    {
      log.warning("classpath directory " + path + " error" + ex.getMessage());
      return result;
    }
    FileFilter fileFilter = new WildcardFileFilter(file);
    File[] thisFiles = fPath.listFiles(fileFilter);
    for (int i = 0; i < thisFiles.length; i++)
    {
      File f = thisFiles[i];
      if (f.exists())
View Full Code Here

      final DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
      final DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
     
      final File directory = new File("data/conf/zones/");
      final File[] files = directory.listFiles(new FileFilter() {

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

      return;
    }
    Detector detector = new Detector();
    detector.setHome(dicHome);
    detector.setFilter(null);
    detector.setFilter(new FileFilter() {
      public boolean accept(File pathname) {
        return pathname.getPath().endsWith(".dic.compiled")
            || pathname.getPath().endsWith(".metadata");
      }
    });
View Full Code Here

    File compliedMetadataFile = new File(dicHomeFile, ".compiled/most-words-mode/.metadata");
    if (compliedMetadataFile.exists() && compliedMetadataFile.isFile()) {
      // get checksum for all compiled dictionaries
      String checksum = Snapshot.flash(
          new File(dicHomeFile, ".compiled/most-words-mode"),
          new FileFilter() {
            public boolean accept(File pathname) {
              return pathname.getPath().endsWith(".dic.compiled");
            }
          }).getCheckSum();
     
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.