Package java.io

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


  /**
   * 只要 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

    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

      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

    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

          // 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

        String filename = System.getProperty("test.pdfbox.util.TextStripper.file");
        File testDir = new File("test/input");

        if ((filename == null) || (filename.length() == 0))
        {
            File[] testFiles = testDir.listFiles(new FilenameFilter()
            {
                public boolean accept(File dir, String name)
                {
                    return (name.endsWith(".pdf"));
                }
View Full Code Here

        String filename = System.getProperty("test.pdfbox.util.TextStripper.file");
        File testDir = new File("test/input");

        if ((filename == null) || (filename.length() == 0))
        {
            File[] testFiles = testDir.listFiles(new FilenameFilter()
            {
                public boolean accept(File dir, String name)
                {
                    return (name.endsWith(".pdf"));
                }
View Full Code Here

  private static final File TORTURE_INVALID_DIR = new File(TORTURE_DIR, "invalid");

  @Test
  public void testSipTortureValid() throws Exception
  {
    File[] testFiles = TORTURE_VALID_DIR.listFiles(new FilenameFilter()
    {
      public boolean accept(File dir, String name)
      {
        return name.endsWith(".dat");
      }
View Full Code Here

  }

  @Test
  public void testSipTortureInvalid() throws Exception
  {
    File[] testFiles = TORTURE_INVALID_DIR.listFiles(new FilenameFilter()
    {
      public boolean accept(File dir, String name)
      {
        return name.endsWith(".dat");
      }
View Full Code Here

TOP

Related Classes of java.io.FilenameFilter

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.