Examples of FilenameFilter


Examples of java.io.FilenameFilter

  private boolean listScripts(final Player player, List<String> filterTerm) {
    // *.groovy scripts is in data/script/
    final File dirGroovy = new File(scriptDir);
    // *.class scripts is in data/script/games/stendhal/server/script/
    final File dirClasses = new File(scriptDir+"games/stendhal/server/script/");
    final String[] scriptsGroovy = dirGroovy.list(new FilenameFilter() {
        public boolean accept(final File dir, final String name) {
          return (name.endsWith(".groovy") && (name.indexOf('$') == -1));
        }
      });
    final String[] scriptsJava = dirClasses.list(new FilenameFilter(){
        public boolean accept(final File dir, final String name) {
          // remove filenames with '$' inside because they are inner classes
          return (name.endsWith(".class") && (name.indexOf('$') == -1));
        }
      });
View Full Code Here

Examples of java.io.FilenameFilter

          Element thumbs = root.addElement( "thumbs" );
         
          File dir = new File(targetDirectory);
         
      //Secoond get all Files of this Folder
      FilenameFilter ff = new FilenameFilter() {
           public boolean accept(File b, String name) {
              String absPath = b.getAbsolutePath()+File.separatorChar+name;
              File f = new File (absPath);
                return f.isFile();
           }
View Full Code Here

Examples of java.io.FilenameFilter

  /**
   * 只要 wordsXXX.dic的文件
   * @return
   */
  protected File[] listWordsFiles() {
    return dicPath.listFiles(new FilenameFilter() {

      public boolean accept(File dir, String name) {
       
        return name.startsWith("words") && name.endsWith(".dic");
      }
View Full Code Here

Examples of java.io.FilenameFilter

    this(analyzer);
    this.path = path;
  }

  public void run(String outputChipName, int n) throws IOException {
    File[] txts = path.listFiles(new FilenameFilter() {

      public boolean accept(File dir, String name) {
     
        return name.endsWith(".txt");
      }
View Full Code Here

Examples of java.io.FilenameFilter

      seg = new SimpleSeg(dic);
    } else {
      seg = new ComplexSeg(dic);
    }
    File path = new File(args[0]);
    File[] txts = path.listFiles(new FilenameFilter() {

      public boolean accept(File dir, String name) {
     
        return name.endsWith(".txt");
      }
View Full Code Here

Examples of java.io.FilenameFilter

    this.path = path;
    this.analyzer = analyzer;
  }

  public void run(String outputChipName, int n) throws IOException {
    File[] txts = path.listFiles(new FilenameFilter() {

      public boolean accept(File dir, String name) {
     
        return name.endsWith(".txt");
      }
View Full Code Here

Examples of java.io.FilenameFilter

          // do this for every item in the classpath
          for (int c = 0; c < sourcepath.size(); c++) {
            String path = (String) sourcepath.elementAt(c) + Config.DIR_SEP_CHAR + arg;
            File pkg = new File(path);
            if (pkg.isDirectory()) {
              String[] files = pkg.list(new FilenameFilter() {
                public boolean accept(File dir, String name) {
                  int index1 = name.lastIndexOf(".");
                  int index2 = name.length();
                  if ((index1 >= 0 && index2 >= 0)
                      && (name.substring(index1, index2).equals(".java") || name.substring(index1, index2)
View Full Code Here

Examples of net.datacrow.util.filefilters.FileNameFilter

        //**********************************************************
        //Local Art
        //**********************************************************
        panelLocalArt = new LocalArtSettingsPanel(importer.getModule());

        FileNameFilter filter =
            importer.getSupportedFileTypes() != null &&
            importer.getSupportedFileTypes().length > 0 ?
            new FileNameFilter(importer.getSupportedFileTypes(), true) : null;
                
           
        //**********************************************************
        //Files / Directories
        //**********************************************************           
View Full Code Here

Examples of net.datacrow.util.filefilters.FileNameFilter

            SelectFileTypesDialog dlg = new SelectFileTypesDialog(module);
            dlg.setVisible(true);
           
            if (dlg.isChanged()) {
                String[] extensions = DcModules.get(module).getSettings().getStringArray(DcRepository.ModuleSettings.stFileImportFileTypes);
                setFilter(extensions.length > 0 ? new FileNameFilter(extensions, true) : null);
            }
        }
    }
View Full Code Here

Examples of net.datacrow.util.filefilters.FileNameFilter

            SelectFileTypesDialog dlg = new SelectFileTypesDialog(module);
            dlg.setVisible(true);
           
            if (dlg.isChanged()) {
                String[] extensions = DcModules.get(module).getSettings().getStringArray(DcRepository.ModuleSettings.stFileImportFileTypes);
                filter = extensions.length > 0 ? new FileNameFilter(extensions, true) : null;
            }
        } else if (ae.getActionCommand().equals("readDir")) {
            readDir();
        } else if (ae.getActionCommand().equals("addFile")) {
            addFile();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.