Read places from a data file. The file is | separated. It may contain
just a historical place name or both historical and modern places names.

@param filename the name of the file to load
193333
public final void load(final String filename) {
        logger.debug("Loading the cache from places file: " + filename);
        try (
            InputStream fis = new FileInputStream(filename);
        ) {
            load(fis);
        } catch (IOException e) {
            logger.error("Problem reading places file", e);
        }
    }
480227
protected byte[] loadClassDataFromFile(String fileName) {
        byte[] classBytes = null;
        try {
            InputStream in = getResourceAsStream(fileName);
            if (in == null) {
                return null;
            }
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            byte buf[] = new byte[1024];
            for (int i = 0;(i = in.read(buf)) != -1;)
                baos.write(buf, 0, i);
            in.close();
            baos.close();
            classBytes = baos.toByteArray();
        }
        catch (Exception ex) {
            return null;
        }
        return classBytes;
    }
30296
static function read($filename) {
        if (file_exists($filename) && self::isReadable($filename)) {
            return file_get_contents($filename);
        }

        return NULL;
    }
1104516
public static String readTextFile(String fileName) {		
		try {
			return readText(new FileInputStream(new File(fileName)));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			
			return null;
		}
	}
1072281
private String[] readIncludeFiles(final String filename, final int depth) {
    logger.info("In readIncludeFiles() for filename='" + filename + "' depth=" + depth);
    if (depth > 10) { // 10 seems like a nice limit... If we're this deep, we're
      // probably in an infinite loop anyway.
      logger.log(Logging.Priority.ERROR.getLevel(), "readIncludeFiles(): Too deep to continue including (depth=" + depth + "). Ending this branch at: " + filename);
      return new String[0];
    }
    final List<String> filenames = new ArrayList<String>();
    java.io.InputStream in = null;
    try {
      final List<InputStream> ioStreams = getInputStreamsForFile(filename);

      for (int i = 0; i < ioStreams.size(); i++) {
        try {
          in = ioStreams.get(i);

          int currentChar = in.read();
          String currentLine = "";
          while (currentChar != -1) {
            if (currentChar == '\r' || currentChar == '\n') {
              if (currentLine.indexOf("#include ") == 0) {
                final String includeFile = replaceVariables(currentLine.substring(9));
                if (includeFile.equals("false")) {
                  logger.info("Found '#include false': Cancelling include processing for this file.");
                  return new String[0];
                }
                logger.info("Found: " + currentLine + ", adding include of '" + includeFile + "' from file='" + filename + "'");
                filenames.add(includeFile);
              }
              currentLine = "";
            } else {
              final byte temp[] = new byte[1];
              temp[0] = (byte) currentChar;
              currentLine += new String(temp, 0, 1);
            }
            currentChar = in.read();
          }
        }
        catch (final java.io.IOException ex) {
          logger.log(Logging.Priority.ERROR.getLevel(), "Unable to read property file to parse include files (" + filename + "): ", ex);
        }
        finally {
          try {
            if (in != null) {
              in.close();
            }
          }
          catch (final java.io.IOException ignored) {
          }
        }
      }
    }
    catch (final java.io.IOException ex) {
      logger.log(Logging.Priority.ERROR.getLevel(), "Unable to read property file to parse include files (" + filename + "): ", ex);
    }
    return filenames.toArray(new String[filenames.size()]);
  }
1367632
public void readFile(String filename) throws ConverterException {
        try {
            content = "";
            final InputStream input = ResourceManager.getInputStream(filename);
            while (input.available() > 0) {
                content = content + (char) input.read();
            }
            input.close();
        } catch (Exception e) {
            throw new ConverterException(e);
        }
    }
435009
private void readFile() {
        if(historyFile.exists()) {
            try (BufferedReader reader = new BufferedReader(new FileReader(historyFile))) {
                String line;
                while((line = reader.readLine()) != null)
                    push(Parser.toCodePoints(line));
            } catch(FileNotFoundException ignored) {
                //AESH-205
            } catch (IOException e) {
                if(logging)
                    LOGGER.log(Level.WARNING, "Failed to read from history file, ", e);
            }
        }
    }
405313
static private String readFile(String fileName) throws IOException {
    BufferedReader br = new BufferedReader(new FileReader(fileName));
    try {
      StringBuilder sb = new StringBuilder();
      String line = br.readLine();

      while (line != null) {
        sb.append(line);
        sb.append("\n");
        line = br.readLine();
      }
      return sb.toString();
    } finally {
      br.close();
    }
  }
968790
def read(self, filename):
        

        try:
            with open(filename, 'r') as _file:
                self._filename = filename
                self.readstream(_file)
            return True

        except IOError:
            self._filename = None
            return False
375582
public DataBinder load(String filename) throws IOException {
        Properties props = new Properties();
        Reader reader = new FileReader(filename);
        props.load(reader);
        reader.close();
        return load(props);
    }
697789
def read(filename):
    """"""
    return codecs.open(os.path.join(__DIR__, filename), 'r').read()
1004524
private void load(String filename)
	{
		try
		{
			load(new FileInputStream(filename));
		}
		catch (FileNotFoundException e)
		{
			e.printStackTrace();
		}
	}
104596
public static Dataset<String, String> readSVMLightFormat(String filename) {
    return readSVMLightFormat(filename, new HashIndex<String>(), new HashIndex<String>());
  }
1330745
@Pure
	public static String[] split(File filename) {
		if (filename == null) {
			return new String[0];
		}
		return filename.getPath().split(Pattern.quote(File.separator));
	}
3249
private void checkForExistence(String fileName) throws IOException {
        File file = new File(fileName);
        if (!file.exists()) {
            throw new FileNotFoundException("File with name " + fileName + " does not exist.");
        }
        if (!file.isFile()) {
            throw new IOException("Provided string does not correspond to an actual file.");
        }

    }
1153396
public File getFile(String fileName) throws IOException {
    validatePathname(fileName);

    String pathname = storageDir + separator + fileName;

    File file = new File(pathname);
    if (!file.exists()) {
      throw new FileNotFoundException(pathname);
    }
    if (!file.isFile()) {
      throw new IOException('\'' + pathname + '\'' + " is not a file");
    }
    return file;
  }
863812
public static void readState(String fname) {

    filename = fname;
    
    try {
      persData.load(new FileInputStream(filename));
    } catch (FileNotFoundException e1) {
      // ignore
    } catch (IOException e) {
      e.printStackTrace();
    }
  }