Creates and returns a GET {@link HttpRequest} instance
for the given <tt>path</tt> over the internal hostname.

@param path Path of the request to build.
@return Built GET request.
@throws IOException If any error occurs while creating the GET request.
8690
public HttpRequest getRequest(final String path) throws IOException {
		final GenericUrl url = getURL(path);
		return requestFactory.buildGetRequest(url);
	}
222786
public InputStream getResourceAsStream(String path) {

		path = path.replace('/', File.separatorChar);
		InputStream is = null;
		try {
			is = new FileInputStream(new File(baseDir, path));
		} catch (FileNotFoundException e) {
			logger.info("File for path : '" + path
					+ "' not found using baseDir '" + baseDir + "'");
		}

		return is;
	}
820804
@Override
    public URL getResource( String path )
    {
        URL url = null;
        if ( baseLoader != null )
            // classloader wants no leading slash
            url = baseLoader.getResource( path.substring(1) );
        if ( url == null )
            url = super.getResource( path );
        return url;
    }
84488
public static String get(String host, String path, Map<String, String> params) throws IOException {
        ExceptionUtil.notNull(host);
        return get(host, path, ParamUtil.getUrlParamsByMap(params));
    }
219465
protected HttpPost generatePostRequest(final String path, final String param) {
        final HttpPost post = new HttpPost(buildUri(path));
        post.setEntity(new StringEntity(param, ContentType.APPLICATION_JSON));
        return post;
    }
396052
public static URL[] getURLs(final String path) {
		final File topDir = new File(path);
		final List list = new ArrayList();
		CClassLoader.getClasses(topDir, list);

		final URL ret[] = new URL[list.size() + 1];

		for (int i = 0; i < list.size(); i++) {
			ret[i] = (URL) list.get(i);
		}

		try {
			ret[list.size()] = topDir.toURI().toURL();
		} catch (final Exception ignore) {
		}

		return ret;
	}
312548
public URL getResource(String path) throws MalformedURLException {
		Result<URL,MalformedURLException> result = getResourceCache.get(path, getResourceRefresher);
		MalformedURLException exception = result.getException();
		if(exception != null) throw exception;
		return result.getValue();
	}
1321159
public JSONObject get(String path) throws APIError {
        return request(Verb.GET, path, null);
    }
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));
    }
934860
public Resource[] getResources(String path) throws IOException {
        if (hasContext()) {
            return context.getResources(path);
        }
        return getContext().getResources(getContextPath() + '/' + path);
    }
1150279
public static String getUrl(String path) {
        if (path == null) {
            return path;
        }

        ServletContext sc = ExecutionContext.getSession().getServletContext();

        if (path.startsWith("jar:")) {
            int i = path.indexOf("!");
            path = i < 0 ? path : path.substring(++i);
        }

        path = sc.getContextPath() + path;
        return path;
    }
1154611
protected InputStream getInputStream (String path)
        throws IOException
    {
        FileInputStream fis = new FileInputStream(path);
        return new BufferedInputStream(fis);
    }
937667
public Resource getResource(String path) {
        final Resource descriptorResource = descriptor.getResource();

        try {
            Resource resource = descriptorResource.createRelative("static" + path);
            if (resource.exists()) {
                return resource;
            }
        } catch (IOException e) {
            return null;
        }
        return null;
    }
169952
public Resource addPath(String path)
        throws IOException,MalformedURLException
    {
        FileResource r=null;

        if (!isDirectory())
        {
            r=(FileResource)super.addPath(path);
        }
        else
        {
            path = org.browsermob.proxy.jetty.util.URI.canonicalPath(path);
            
            // treat all paths being added as relative
            String rel=path;
            if (path.startsWith("/"))
                rel = path.substring(1);
            
            File newFile = new File(_file,rel.replace('/', File.separatorChar));
            r=new FileResource(newFile.toURI().toURL(),null,newFile);
        }
        
        String encoded= org.browsermob.proxy.jetty.util.URI.encodePath(path);
        int expected=r._urlString.length()-encoded.length();
        int index = r._urlString.lastIndexOf(encoded, expected);
        
        if (expected!=index && ((expected-1)!=index || path.endsWith("/") || !r.isDirectory()))
        {
            r._alias=r._url;
            r._aliasChecked=true;
        }                   
        return r;
    }
328435
public @Nonnull Optional<URL> getResource(@Nonnull String path) {
        ArgumentUtils.requireNonNull("path", path);
        Optional<ResourceLoader> resourceLoader = getSupportingLoader(path);
        if (resourceLoader.isPresent()) {
            return resourceLoader.get().getResource(path);
        }
        return Optional.empty();
    }
653891
public static BufferedWriter newBufferedWriter(Path path) throws IOException {
        FileUtils.checkDirectory(path.getParent());
        BufferedWriter bufferedWriter;
        if (path.toFile().getName().endsWith(".gz")) {
            bufferedWriter = new BufferedWriter(new OutputStreamWriter(new GZIPOutputStream(new FileOutputStream(path.toFile()))));
        } else {
            bufferedWriter = Files.newBufferedWriter(path, Charset.defaultCharset());
        }
        return bufferedWriter;
    }
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);
  }