Reads the response message from a file in the current web app.

@param pFileName
@return the message
771709
private String readMessage(String pFileName) {
        try {
            // Read resource from web app
            InputStream is = getServletContext().getResourceAsStream(pFileName);

            if (is != null) {
                return new String(FileUtil.read(is));
            }
            else {
                log("File not found: " + pFileName);
            }
        }
        catch (IOException ioe) {
            log("Error reading file: " + pFileName + " (" + ioe.getMessage() + ")");
        }
        return null;
    }
482446
public static ProjectReader getProjectReader(String name) throws MPXJException
   {
      int index = name.lastIndexOf('.');
      if (index == -1)
      {
         throw new IllegalArgumentException("Filename has no extension: " + name);
      }

      String extension = name.substring(index + 1).toUpperCase();

      Class<? extends ProjectReader> fileClass = READER_MAP.get(extension);
      if (fileClass == null)
      {
         throw new IllegalArgumentException("Cannot read files of type: " + extension);
      }

      try
      {
         ProjectReader file = fileClass.newInstance();
         return (file);
      }

      catch (Exception ex)
      {
         throw new MPXJException("Failed to load project reader", ex);
      }
   }
362772
public String readSnippet(String name) {

        String path = CmsStringUtil.joinPaths(
            m_ui.getUpdateBean().getWebAppRfsPath(),
            CmsUpdateBean.FOLDER_UPDATE,
            "html",
            name);
        try (InputStream stream = new FileInputStream(path)) {
            byte[] data = CmsFileUtil.readFully(stream, false);
            String result = new String(data, "UTF-8");
            return result;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
971849
public static byte[] readFile(File input) throws IOException {
        return Files.readAllBytes(Paths.get(input.getAbsolutePath()));
    }
74121
def read_file(filename):
    """"""
    p = path.abspath(path.dirname(__file__))
    filepath = path.join(p, filename)
    try:
        return open(filepath).read()
    except IOError:
        return ''
713399
@SuppressWarnings("resource")
    public static byte[] readFile(String filename) throws IOException {

        // create input and output stream
        InputStream in = CmsFileUtil.class.getClassLoader().getResourceAsStream(filename);
        if (in == null) {
            throw new FileNotFoundException(filename);
        }

        return readFully(in);
    }
307082
function readFile(filename) {
	return new Promise(
		(resolve, reject) => fs.readFile(filename, 'utf8',
			(error, data) => error ? reject(error) : resolve(data)
		)
	);
}
699823
@SuppressWarnings("resource")
    public InputStream getInputStream(String filename)
    {
        InputStream streamIn = null;
        if (filename.indexOf(':') == -1)
        {
            String filepath = ((BaseHttpTask)this.getTask()).getRealPath(this.getServletRequest(), filename);
            if (filepath != null)
            {
	            File file = new File(filepath);
	            try   {
	                streamIn = new FileInputStream(file);
	            } catch (FileNotFoundException ex)  {
	                streamIn = null;
	            }
            }
        }
        if (streamIn == null)
            streamIn = Utility.getInputStream(filename, this.getApplication());
        return streamIn;
    }
14902
static String readFile(String file) {

        try {
            FileReader     reader = new FileReader(file);
            BufferedReader read   = new BufferedReader(reader);
            StringBuffer   b      = new StringBuffer();
            String         s      = null;
            int            count  = 0;

            while ((s = read.readLine()) != null) {
                count++;

                b.append(s);
                b.append('\n');
            }

            read.close();
            reader.close();

            return b.toString();
        } catch (IOException e) {
            return e.getMessage();
        }
    }
785210
public com.google.protobuf.ByteString
      getFilenameBytes() {
    java.lang.Object ref = filename_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      filename_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
1287764
def _read_pem_file(cls, filename, from_package=False):
        '''
        '''
        _logger.debug('Reading PEM {0}.'.format(filename))

        if from_package:
            return wpull.util.filter_pem(wpull.util.get_package_data(filename))

        with open(filename, 'rb') as in_file:
            return wpull.util.filter_pem(in_file.read())
1077612
public static String parseNonceFromDigestFilename(String filename) {
        if (filename == null || !filename.endsWith(".digest")) {
            throw new IllegalArgumentException("Bad digest filename: " + filename);
        }

        return parseNonceFromSnapshotFilename(filename);
    }
1259589
public String readFile(String filename)
    {
        String path = m_fileSource.getParent();
        String string = Utility.transferURLStream("file:" + path + '/' + filename, null, null, null);
        if (string != null)
        {
            int start = string.indexOf("<repository");
            if (start != -1)
                start = string.indexOf(">", start);
            int end = string.lastIndexOf("</repository>");
            if ((start != -1) && (end != -1))
                string = string.substring(start + 1, end);
        }
        return string;
    }
124008
public static String readFileToString(@NotNull String resource) {
        try {
            try (Reader r = new BufferedReader(new InputStreamReader(new FileInputStream(resource), "UTF-8"))) {

                Writer writer = new StringWriter();

                char[] buffer = new char[1024];
                int n;
                while ((n = r.read(buffer)) != -1) {
                    writer.write(buffer, 0, n);
                }

                return writer.toString();
            }
        } catch (IOException ioe) {
            throw new RuntimeException(ioe);
        }
    }
130768
public static String readFile( String name ) throws IOException {
        StringBuilder b = new StringBuilder();
        BufferedReader r = new BufferedReader(new FileReader(name));
        String line;
        while( (line = r.readLine()) != null ) {
            b.append(line).append('\n');
        }
        r.close();
        return b.toString();
    }
958301
static String getFile( String name )
        throws FileNotFoundException, IOException
    {
        StringBuilder sb = new StringBuilder();
        try ( BufferedReader bin = new BufferedReader( new FileReader( name ) ) ) {
            String line;
            while ( (line=bin.readLine()) != null )
                sb.append( line ).append( "\n" );
        }
        return sb.toString();
    }
58759
public static BufferedReader asBufferedReader(String fileName) throws IOException {
		Validate.notBlank(fileName, "filename is blank");
		return asBufferedReader(getPath(fileName));
	}