Load a collection of parse trees from the file of given name.
Each tree may optionally be encased in parens to allow for Penn
Treebank style trees.
This methods implements the <code>FileProcessor</code> interface.

@param file file to load a tree from
975874
public void processFile(File file) {
    TreeReader tr = null;

    // SRL stuff
    CollectionValuedMap<Integer,String> srlMap = null;
    if (this.srlMap != null) {
      // there must be a better way ...
      String filename = file.getAbsolutePath();
      for (String suffix : this.srlMap.keySet()) {
        if (filename.endsWith(suffix)) {
          srlMap = this.srlMap.get(suffix);
          break;
        }
      }
      if (srlMap == null) {
        System.err.println("could not find SRL entries for file: "+file);
      }
    }

    try {
      // maybe print file name to stdout to get some feedback
      if (PRINT_FILENAMES) {
        System.err.println(file);
      }
      // could throw an IO exception if can't open for reading
      tr = treeReaderFactory().newTreeReader(new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding())));
      int sentIndex=0;
      Tree pt;
      while ((pt = tr.readTree()) != null) {
        if (pt.label() instanceof HasIndex) { // so we can trace where this tree came from
          HasIndex hi = (HasIndex) pt.label();
          hi.setDocID(file.getName());
          hi.setSentIndex(sentIndex);
        }
        if (srlMap == null) {
          parseTrees.add(pt);
        } else {
          Collection<String> srls = srlMap.get(sentIndex);
//           pt.pennPrint();
//           System.err.println(srls);
          parseTrees.add(pt);
          if (srls.isEmpty()) {
//            parseTrees.add(pt);
          } else {
            for (String srl : srls) {
//              Tree t = pt.deepCopy();
              String[] bits = srl.split("\\s+");
              int verbIndex = Integer.parseInt(bits[0]);
              String lemma = bits[2].split("\\.")[0];
//              Tree verb = Trees.getTerminal(t, verbIndex);
              Tree verb = Trees.getTerminal(pt, verbIndex);
//              ((CoreLabel)verb.label()).set(SRLIDAnnotation.class, SRL_ID.REL);
              ((CoreLabel)verb.label()).set(CoreAnnotations.CoNLLPredicateAnnotation.class, true);
              for (int i = 4; i < bits.length; i++) {
                String arg = bits[i];
                String[] bits1;
                if (arg.indexOf("ARGM") >= 0) {
                  bits1 = arg.split("-");
                } else {
                  bits1 = arg.split("-");
                }
                String locs = bits1[0];
                String argType = bits1[1];
                if (argType.equals("rel")) {
                  continue;
                }
                for (String loc : locs.split("[*,]")) {
                  bits1 = loc.split(":");
                  int term = Integer.parseInt(bits1[0]);
                  int height = Integer.parseInt(bits1[1]);
//                  Tree t1 = Trees.getPreTerminal(t, term);
                  Tree t1 = Trees.getPreTerminal(pt, term);
                  for (int j = 0; j < height; j++) {
//                    t1 = t1.parent(t);
                    t1 = t1.parent(pt);
                  }
                  Map<Integer,String> roleMap = ((CoreLabel)t1.label()).get(CoreAnnotations.CoNLLSRLAnnotation.class);
                  if (roleMap == null) {
                    roleMap = new HashMap<Integer, String>();
                    ((CoreLabel)t1.label()).set(CoreAnnotations.CoNLLSRLAnnotation.class, roleMap);
                  }
                  roleMap.put(verbIndex, argType);
//                  ((CoreLabel)t1.label()).set(SRLIDAnnotation.class, SRL_ID.ARG);
                }
              }
//               for (Tree t1 : t) {
//                 if (t1.isLeaf()) { continue; }
//                 CoreLabel fl = (CoreLabel)t1.label();
//                 if (fl.value() == null) { continue; }
//                 if (!fl.has(SRLIDAnnotation.class)) {
//                   boolean allNone = true;
//                   for (Tree t2 : t1) {
//                     SRL_ID s = ((CoreLabel)t2.label()).get(SRLIDAnnotation.class);
//                     if (s == SRL_ID.ARG || s == SRL_ID.REL) {
//                       allNone = false;
//                       break;
//                     }
//                   }
//                   if (allNone) {
//                     fl.set(SRLIDAnnotation.class, SRL_ID.ALL_NO);
//                   } else {
//                     fl.set(SRLIDAnnotation.class, SRL_ID.NO);
//                   }
//                 }
//               }
//              parseTrees.add(t);
            }
          }
        }

        sentIndex++;
      }
    } catch (IOException e) {
      System.err.println("loadTree IO Exception: " + e + " in file " + file);
    } finally {
      try {
        if (tr != null) {
          tr.close();  // important: closes file even if error!
        }
      } catch (IOException e) {
        // do nothin'
      }
    }
  }
1094010
public static void parse(DocListener document, String file) {
        HtmlParser p = new HtmlParser();
        p.go(document, file);
    }
168818
public void load(File file) throws IOException {
        _entryFile = file;
        Chronos c = new Chronos();
        ChannelReader in = new ChannelReader(file);

        try {
            in.open();

            // Read entry head
            long fileVersion = in.readLong();
            if (fileVersion != STORAGE_VERSION) {
                throw new RuntimeException("Wrong storage version " + fileVersion + " encounted in " + file.getAbsolutePath() + ". Version " + STORAGE_VERSION
                        + " expected.");
            }

            long minScnHead = in.readLong();
            long maxScnHead = in.readLong();
            int length = in.readInt();

            // Read entry body
            loadDataSection(in, length);

            // Read entry tail
            long minScnTail = in.readLong();
            long maxScnTail = in.readLong();

            if (minScnHead != minScnTail) {
                throw new IOException("min scns don't match: " + minScnHead + " vs " + minScnTail);
            }
            if (maxScnHead != maxScnTail) {
                throw new IOException("max scns don't match:" + maxScnHead + " vs " + maxScnTail);
            }

            _minScn = minScnHead;
            _maxScn = maxScnHead;

            if(_log.isInfoEnabled()) {
                _log.info("loaded entry: minScn=" + _minScn + " maxScn=" + _maxScn + " size=" + size() + " file=" + file.getName() + " in " + c.getElapsedTime());
            }
        } finally {
            in.close();
        }
    }
1004524
private void load(String filename)
	{
		try
		{
			load(new FileInputStream(filename));
		}
		catch (FileNotFoundException e)
		{
			e.printStackTrace();
		}
	}
1323463
protected void loadProperties(String filename) {
		ClassLoader thclassLoader = Thread.currentThread().getContextClassLoader();
		if (thclassLoader != null){
			URL url = thclassLoader.getResource(filename);
			if (url != null){
				try {
					this.setXMLProperties(url.openStream(), null);
				} catch (Exception e) {
					// do nothing
				} 
			}
		}
	}
1111183
public synchronized Node parse(File file) throws IOException, SAXException {
        return parse(new InputSource(file.toURI().toURL().toString()));
    }
763898
public static List<File> findAllFile(File file) {
        if (file == null || !file.exists()) {
            return Collections.emptyList();
        }

        if (file.isFile()) {
            return Collections.singletonList(file);
        }

        List<File> fileList = new ArrayList<>();
        File[] files = file.listFiles();
        for (File f : files) {
            fileList.addAll(findAllFile(f));
        }

        return fileList;
    }
1059961
public static RegionMetadata load
    (final File file) throws IOException {
        return RegionMetadataParser.parse(new BufferedInputStream(new
                FileInputStream(file)));
    }
825486
public void load(File authorizationFile) throws AuthorizationFileException {
        FileInputStream fis = null;
        try {
            fis = new FileInputStream(authorizationFile);
            ANTLRInputStream stream = new ANTLRInputStream(fis);
            SAFPLexer lexer = new SAFPLexer(stream);
            CommonTokenStream tokens = new CommonTokenStream(lexer);
            SAFPParser parser = new SAFPParser(tokens);
            parser.prog();
            setAccessRules(parser.getAccessRules());
            setGroups(parser.getGroups());
            setAliases(parser.getAliases());
        } catch (FileNotFoundException e) {
            throw new AuthorizationFileException("FileNotFoundException: ", e);
        } catch (IOException e) {
            throw new AuthorizationFileException("IOException: ", e);
        } catch (RecognitionException e) {
            throw new AuthorizationFileException("Parser problem: ", e);
        } finally {
            try {
                fis.close();
            } catch (IOException e) {
                throw new AuthorizationFileException("IOExcetion during close: ", e);
            }
        }
    }
212327
public static Configuration load(String file)
    throws IOException, SAXException {
    ConfigurationImpl cfg = new ConfigurationImpl();

    XMLReader parser = XMLReaderFactory.createXMLReader();
    parser.setContentHandler(new ConfigHandler(cfg, file));
    if (file.startsWith("classpath:")) {
      String resource = file.substring("classpath:".length());
      ClassLoader cloader = Thread.currentThread().getContextClassLoader();
      InputStream istream = cloader.getResourceAsStream(resource);
      parser.parse(new InputSource(istream));
    } else
      parser.parse(file);

    return cfg;
  }
1284725
public void load(String filename) throws FileNotFoundException, SAXException, IOException, ParserConfigurationException {
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    loadMessages(builder.parse(new CSFileInputStream(filename)));
  }
1311381
public static void parse(DocListener document, String file) {
        XmlParser p = new XmlParser();
        p.go(document, file);
    }
16359
public void loadFile(File file)
   {
      InputStream is = null;

      try
      {
         is = new FileInputStream(file);
         POIFSFileSystem fs = new POIFSFileSystem(is);
         m_model.setFile(fs);
      }

      catch (IOException ex)
      {
         throw new RuntimeException(ex);
      }

      finally
      {
         StreamHelper.closeQuietly(is);
      }
   }
280267
public static NaaccrDictionary readDictionary(File file) throws IOException {
        if (file == null)
            throw new IOException("File is required to load dictionary.");
        if (!file.exists())
            throw new IOException("File must exist to load dictionary.");
        try (Reader reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8)) {
            return readDictionary(reader);
        }
    }
258529
def load_forest
      trees = []
      if File.exists?(@forest_file)
        begin
          trees = Psych.load(File.open @forest_file)
        rescue ArgumentError => e
          raise Nimbus::WrongFormatFileError, "It was not posible to parse the random forest file (#{@forest_file}): \r\n#{e.message} "
        end
      else
        raise Nimbus::InputFileError, "Forest file not found (#{@forest_file})"
      end
      forest = Nimbus::Forest.new self
      forest.trees = trees
      forest
    end
949267
public static Properties load(File file) throws IOException {
        if (file.isFile()) {
            FileInputStream fis = null;
            try {
                Properties headers = new Properties();
                fis = new FileInputStream(file);
                headers.load(fis);
                return headers;
            } finally {
                IOUtils.closeQuietly(fis);
            }
        }
        return new Properties();
    }
595314
public BinarySparseDataset parse(File file) throws IOException, ParseException {
        String name = file.getPath();
        return parse(name, new FileInputStream(file));
    }