Helper method to read the content of an included Javascript file.<p>

@param path the root path of a Javascript file

@return the content of the Javascript file
552707
private String readFile(String path) {

        String result = (String)CmsVfsMemoryObjectCache.getVfsMemoryObjectCache().getCachedObject(m_cms, path);
        if (result == null) {
            try {
                CmsFile file = m_cms.readFile(path);
                result = getContentAsString(file);
            } catch (CmsException e) {
                throw new RuntimeException(e);
            }
        }
        if (result != null) {
            CmsVfsMemoryObjectCache.getVfsMemoryObjectCache().putCachedObject(m_cms, path, result);
        }
        return result;

    }
476162
public void getLink(String path, final I_CmsStringCallback callback) {

        m_apiRoot.getRpcHelper().executeRpc(CmsXmlContentUgcApi.SERVICE.getLink(path, new AsyncCallback<String>() {

            @SuppressWarnings("synthetic-access")
            public void onFailure(Throwable caught) {

                m_apiRoot.handleError(caught, null);
            }

            public void onSuccess(String result) {

                callback.call(result);
            }
        }));
    }
800443
public static File[] ls(String path) {
		if (path == null) {
			return null;
		}

		path = getAbsolutePath(path);

		File file = file(path);
		if (file.isDirectory()) {
			return file.listFiles();
		}
		throw new IORuntimeException(StrUtil.format("Path [{}] is not directory!", path));
	}
407922
public static List<File> getFilesInDirectoryTree(String path, String includeMask) {
		File file = new File(path);
		return getContentsInDirectoryTree(file, includeMask, true, false);
	}
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);
	}
814509
public static String readResourceAsStream(String path) {
        try {
            InputStream inputStream = ResourceUtil.getResourceAsStream(path);
            return ResourceUtil.readFromInputStreamIntoString(inputStream);
        } catch (Exception e) {
            throw new DataUtilException("Failed to load resource", e);
        }
    }
888576
public JSON readFromFile( String path ) {
      return readFromStream( Thread.currentThread()
            .getContextClassLoader()
            .getResourceAsStream( path ) );
   }
20325
public InputStream getResource (String path)
        throws IOException
    {
        String localePath = getLocalePath(path);
        InputStream in;

        // first look for this resource in our default resource bundle
        for (ResourceBundle bundle : _default) {
            // Try a localized version first.
            if (localePath != null) {
                in = bundle.getResource(localePath);
                if (in != null) {
                    return in;
                }
            }
            // If that didn't work, try generic.
            in = bundle.getResource(path);
            if (in != null) {
                return in;
            }
        }

        // fallback next to an unpacked resource file
        File file = getResourceFile(path);
        if (file != null && file.exists()) {
            return new FileInputStream(file);
        }

        // if we still didn't find anything, try the classloader; first try a locale-specific file
        if (localePath != null) {
            in = getInputStreamFromClasspath(PathUtil.appendPath(_rootPath, localePath));
            if (in != null) {
                return in;
            }
        }

        // if we didn't find that, try locale-neutral
        in = getInputStreamFromClasspath(PathUtil.appendPath(_rootPath, path));
        if (in != null) {
            return in;
        }

        // if we still haven't found it, we throw an exception
        throw new FileNotFoundException("Unable to locate resource [path=" + path + "]");
    }
1166632
public static ArrayList<File> getFilesInDirectoryTree(String path) {
		File directory = new File(path);
		return getContentsInDirectoryTree(directory, "*", true, false);
	}
610776
public static BufferedReader getReader(String path, Charset charset) throws IORuntimeException {
		return getReader(file(path), charset);
	}
462594
private String getContent(TreeLogger logger, String path, String src)
      throws UnableToCompleteException {
    HttpURLConnection connection = null;
    InputStream in = null;
    try {
      if (!src.matches("(?i)https?://.*")) {
        String file = path + "/" + src;
        in = this.getClass().getClassLoader().getResourceAsStream(file);
        if (in == null) {
          // If we didn't find the resource relative to the package, assume it is absolute.
          file = src;
          in = this.getClass().getClassLoader().getResourceAsStream(file); 
        }
        if (in != null) {
          logger.log(TreeLogger.INFO, getClass().getSimpleName()
              + " - importing external javascript: " + file);
        } else {
          logger.log(TreeLogger.ERROR, "Unable to read javascript file: " + file);
        }
      } else {
        logger.log(TreeLogger.INFO, getClass().getSimpleName()
            + " - downloading external javascript: " + src);
        URL url = new URL(src);
        connection = (HttpURLConnection) url.openConnection();
        connection.setRequestProperty("Accept-Encoding", "gzip, deflate");
        connection.setRequestProperty("Host", url.getHost());
        connection.setConnectTimeout(3000);
        connection.setReadTimeout(3000);

        int status = connection.getResponseCode();
        if (status != HttpURLConnection.HTTP_OK) {
          logger.log(TreeLogger.ERROR, "Server Error: " + status + " "
              + connection.getResponseMessage());
          throw new UnableToCompleteException();
        }

        String encoding = connection.getContentEncoding();
        in = connection.getInputStream();
        if ("gzip".equalsIgnoreCase(encoding)) {
          in = new GZIPInputStream(in);
        } else if ("deflate".equalsIgnoreCase(encoding)) {
          in = new InflaterInputStream(in);
        }
      }

      return inputStreamToString(in);
    } catch (IOException e) {
      logger.log(TreeLogger.ERROR, "Error: " + e.getMessage());
      throw new UnableToCompleteException();
    } finally {
      if (connection != null) {
        connection.disconnect();
      }
    }
  }
906248
@Override
    public InputStream getResourceAsStream(final String path) {
        final ResourceList resourceList = scanResult.getResourcesWithPath(path);
        if (resourceList == null || resourceList.isEmpty()) {
            return super.getResourceAsStream(path);
        } else {
            try {
                return resourceList.get(0).open();
            } catch (final IOException e) {
                return null;
            }
        }
    }
1260936
def get_compiled_file_content(path)
      begin
        Tilt.new(path.to_s).render({}, {
          :spec => spec
        })
      rescue RuntimeError
        File.read(path)
      end
    end
778402
private String getStringValue(String path) {

        I_CmsXmlContentValue value = m_content.getValue(path, Locale.ENGLISH);
        if (value == null) {
            return null;
        } else {
            return value.getStringValue(m_cms);
        }
    }
761793
protected Properties readConfigFile(String path) {
		Properties props = new Properties();
		// Load properties file
		InputStream is = null;
		try {
			if (path.startsWith(FILE_PREFIX)) {
				if (LOGGER.isDebugEnabled() && !checking)
					LOGGER.debug("Using filesystem properties file location at: " + configLocation);
				is = new FileInputStream(new File(path.substring(FILE_PREFIX.length())));
			} else {
				if (LOGGER.isDebugEnabled() && !checking)
					LOGGER.debug("Reading properties from file at classpath: " + configLocation);
				is = ClassLoaderResourceUtils.getResourceAsStream(path, this);
			}
			loadConfig(props, path, is);

		} catch (IOException e) {
			throw new IllegalArgumentException("jawr configuration could not be found at " + path
					+ ". Make sure parameter is properly set " + "in web.xml. ");
		} finally {
			IOUtils.close(is);
		}

		return props;
	}
655031
def file_get_contents(self, path):
        

        with open(self.get_full_file_path(path), 'r') as f: return  f.read()
1143588
@Override
    public InputStream getResourceAsStream( String path )
    {
        Object in = null;
        if ( null != baseLoader )
            // classloader wants no leading slash
            in = baseLoader.getResourceAsStream( path.substring(1) );
        if ( null == in )
            return super.getResourceAsStream( path );
        return (InputStream) in;
    }