Return target file's content from resource's path.<br>
Resource is used caller class.

@param path resource's path
@return read result
5608
public static String readResource(String path)
    {
        Class<?> callerClass = resolveCaller();
        if (callerClass == null)
        {
            return null;
        }

        return readResource(resolveCaller(), path);
    }
1061700
private InputStream tryPath(String path) {
    Logger.getLogger().debug("Trying path \"" + path + "\".");
    return getClass().getResourceAsStream(path);
  }
1154611
protected InputStream getInputStream (String path)
        throws IOException
    {
        FileInputStream fis = new FileInputStream(path);
        return new BufferedInputStream(fis);
    }
1252109
public Stream<URL> getResources(String path) {
        Enumeration<URL> all;
        try {
            all = classLoader.getResources(prefixPath(path));
        } catch (IOException e) {
            return Stream.empty();
        }
        Stream.Builder<URL> builder = Stream.builder();
        while (all.hasMoreElements()) {
            URL url = all.nextElement();
            builder.accept(url);
        }
        return builder.build();
    }
313480
public static String readFile(String path) throws IOException {
        if (path.startsWith(ValueConsts.CLASSPATH_PREFIX)) {
            return read(FileExecutor.class.getResourceAsStream(path.substring(ValueConsts.CLASSPATH_PREFIX.length())));
        }
        return readFile(new File(path));
    }
1187728
public static Map<String, String> read(final String path) {

        Map<String, String> map = new HashMap<String, String>();

        if (path != null) {
            try {
                Properties p = loadProperties(path);

                for (Object key : p.keySet()) {

                    String value = p.getProperty(String.valueOf(key));

                    // remove single/double quotes
                    if ((value.startsWith("\"") && value.endsWith("\"")) ||
                            (value.startsWith("\'") && value.endsWith("\'"))) {
                        value = value.substring(1, value.length() - 1);
                    }

                    value = value.trim();

                    if (!value.equals("")) {
                        map.put(String.valueOf(key), value);
                    }
                }

            } catch (Exception e) {
                log.error(e.getMessage(), e);
            }
        }

        return map;
    }
172202
@Override
	public Set<InputStream> getResourcesAsStream(final String path) throws IOException
	{
		// For local paths, try to resolve the path relative to the folder of the master file
		// N.B. Assumes paths are sensible, not .//someFile.xml
		if (path.startsWith("./"))
		{
			final Set<InputStream> streams = inner.getResourcesAsStream(folder + path.substring(2));

			if (streams != null && !streams.isEmpty())
				return streams;
		}

		return inner.getResourcesAsStream(path);
	}
763793
public static String readFirstLine(String path) throws FileNotFoundException, IOException {
        try (FileInputStream fis = new FileInputStream(path)) {
            try (InputStreamReader isr = new InputStreamReader(fis)) {
                try (BufferedReader br = new BufferedReader(isr)) {
                    return br.readLine();
                }
            }
        }
    }
865583
public static Image load(String path)
  {
    BufferedImage image = null;

    try
    {
      InputStream in = ImageUtils.class.getClassLoader().getResourceAsStream(path);
      image = ImageIO.read(in);
      in.close();
    }
    catch (Exception e)
    {
      throw new RuntimeException("Could not load image with path: " + path, e);
    }

    return image;

  }
544466
def read_file(cls, path):
        
        with open(path, encoding="utf-8") as file:
            file_contents = file.read()
            return cls.read(file_contents)
316523
public static Single<String> read(String path) {
        return SingleRxXian.call("cosService", "cosRead", new JSONObject() {{
            put("path", path);
        }}).flatMap(response -> {
            response.throwExceptionIfNotSuccess();
            return Single.just(Objects.requireNonNull(response.dataToStr()));
        });
    }
645198
public final IO.Readable open(String path, byte priority) throws IOException {
		Object pointer = getResourcePointer(path);
		AbstractClassLoader cl = this;
		if (pointer == null) {
			if (subLoaders != null)
				for (AbstractClassLoader sub : subLoaders) {
					pointer = sub.getResourcePointer(path);
					if (pointer != null) {
						cl = sub;
						break;
					}
				}
			if (pointer == null)
				throw new FileNotFoundException(path);
		}
		return cl.openResourcePointer(pointer, priority);
	}
1103348
public static String getResourceAsString(final String resourcePath) {
        File resource = getFileForResource(resourcePath);

        if (!resource.exists() || resource.isDirectory()) {
            logger.error("Cannot read resource, does not exist"
                    + " (or is a directory).");
            return "";
        }

        try {
            return FileUtils.readFileToString(resource);
        } catch (IOException ioe) {
            logger.error(ioe.getMessage());
            return "";
        }
    }
304233
private static InputStream getResourceAsStream(String path) throws IOException {
    if (StringUtils.isEmpty(path)) {
      return null;
    }

    // first try to load as file
    File file = new File(path);
    if (file.exists() && file.isFile()) {
      return new FileInputStream(file);
    }

    // if not a file fallback to classloader resource
    return CertificateLoader.class.getResourceAsStream(path);
  }
628503
public static ReadableByteChannel getInstance(Path path) throws IOException
    {
        return FileChannel.open(path, StandardOpenOption.READ);
    }
334895
public static LocalCall<List<String>> readdir(String path) {
        return new LocalCall<>("file.readdir", Optional.of(Collections.singletonList(path)),
                Optional.empty(), new TypeToken<List<String>>(){});
    }
1197980
public static SimpleFeatureCollection readNMEAfile( String path ) throws IOException {

        OmsNmeaFeatureReader reader = new OmsNmeaFeatureReader();
        reader.file = path;
        reader.readFeatureCollection();

        return reader.geodata;
    }