Package java.io

Examples of java.io.File.list()


      NumberFormat nf = NumberFormat.getInstance();
      nf.setMaximumIntegerDigits(1); nf.setMaximumFractionDigits(3);
    for (int i=0; i < CATEGORIES.length; ++i)
       {
    File classDir = new File(TESTING_DIR, CATEGORIES[i]);
    String[] testingFiles = classDir.list();
       
        //*-- for each file, find the best category using the classifier and compare with the
        //*-- designated category
    for (int j = 0; j < testingFiles.length; ++j)
         {
View Full Code Here


      NumberFormat nf = NumberFormat.getInstance();
      nf.setMaximumIntegerDigits(1); nf.setMaximumFractionDigits(3);
    for (int i=0; i < CATEGORIES.length; ++i)
       {
    File classDir = new File(TESTING_DIR, CATEGORIES[i]);
    String[] testingFiles = classDir.list();
       
        //*-- for each file, find the best category using the classifier and compare with the
        //*-- designated category
    for (int j=0; j < testingFiles.length; ++j)
         {
View Full Code Here

      NumberFormat nf = NumberFormat.getInstance();
      nf.setMaximumIntegerDigits(1); nf.setMaximumFractionDigits(3);
    for (int i=0; i < CATEGORIES.length; ++i)
       {
    File classDir = new File(TESTING_DIR, CATEGORIES[i]);
    String[] testingFiles = classDir.list();
       
        //*-- for each file, find the best category using the classifier and compare with the
        //*-- designated category
    for (int j=0; j < testingFiles.length; ++j)
         {
View Full Code Here

        try {
            // open up the plugin directory
            pluginDir = new File(this.pluginDir);
            if (!pluginDir.isDirectory())
                return;
            files = pluginDir.list();
        } catch (Exception exception) {
            return;
        }

        boolean ignoreIncompatible =
View Full Code Here

    //*-- skip hidden directories
    //if (skipHidden && d.isHidden()) { return(flist); }
    if (skipHidden && d.getName().startsWith(".") ) return (flist);
 
    // *-- get the list of files that have handlers
    String[] files = d.list(new OnlyFilterable(this)); String fname = "";
    try
    {
      //*-- use the slash separator consistently across Windows and Linux
      String prefix = (dir.endsWith("/") ) ? dir: dir + "/";
     
View Full Code Here

   File classDir = new File(TRAINING_DIR, CATEGORIES[i]);
   if (!classDir.isDirectory())
   { logger.fatal("Could not find training directory=" + classDir); }

   //*-- get the list of training files for the category and train the classifier on each of the files
   String[] trainingFiles = classDir.list();
   for (int j=0; j<trainingFiles.length; ++j)
   {
    String text = Files.readFromFile(new File(classDir,trainingFiles[j]));
    logger.debug("Training on " + CATEGORIES[i] + File.separator + trainingFiles[j]);
    classifier.train(CATEGORIES[i], text);
View Full Code Here

   File classDir = new File(TRAINING_DIR, CATEGORIES[i]);
   if (!classDir.isDirectory())
   { logger.fatal("Could not find training directory=" + classDir); }

   //*-- get the list of training files for the category and train the classifier on each of the files
   String[] trainingFiles = classDir.list();
   for (int j = 0; j < trainingFiles.length; ++j)
   {
    String text = Files.readFromFile(new File(classDir,trainingFiles[j]));
    logger.debug("Training on " + CATEGORIES[i] + File.separator + trainingFiles[j]);
    classifier.train(CATEGORIES[i], text);
View Full Code Here

   File classDir = new File(TRAINING_DIR, CATEGORIES[i]);
   if (!classDir.isDirectory())
   { logger.fatal("Could not find training directory for category: " + classDir); }

   //*-- get the list of training files for the category and train the classifier on each of the files
   String[] trainingFiles = classDir.list();
   for (int j = 0; j < trainingFiles.length; ++j)
   {
    String text = Files.readFromFile(new File(classDir,trainingFiles[j]));
    logger.debug("Training on " + CATEGORIES[i] + File.separator + trainingFiles[j]);
    classifier.train(CATEGORIES[i], text);
View Full Code Here

      logger.info("processing {}", fileName);
      String filecontent = FileUtils.readFileToString(file, encoding);
      filecontent = Replacer.process(filecontent, replacers);
      writeToFile(filecontent, fileName, encoding);
    } else {
      String[] subFiles = file.list(new FilenameFilter() {
        public boolean accept(File dir, String name) {
          if (dir.isDirectory()) return true;
          boolean matched = false;
          for (String key : profiles.keySet()) {
            matched = name.endsWith(key);
View Full Code Here

    } catch (URISyntaxException e) {
      throw new RuntimeException(e);
    }
    List<E> result = new ArrayList();
    if (directory.exists()) {
      String[] files = directory.list();
      for (int i = 0; i < files.length; i++) {
        if (files[i].endsWith(".class")) {
          String classname = files[i].substring(0,
              files[i].length() - 6);
          try {
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.