Performs GET request.

@param path Request path.
@throws IOException   If error during HTTP connection or entity parsing occurs.
@throws RESTException If HTTP response code is non OK.
764637
public Response get(String path) throws IOException, RESTException {
        return get(path, null, null);
    }
234321
public <T> ApruveResponse<T> get(String path, Class<T> resultType) {
		Response response = restRequest(path).get();
		return processResponse(response, resultType);
	}
773048
public void handleGet(HttpRequest request,
                          HttpResponse response,
                          String pathInContext,
                          String pathParams,
                          Resource resource)
        throws IOException
    {
        if(log.isDebugEnabled())log.debug("Looking for "+resource);
        
        if (resource!=null && resource.exists())
        {            
            // check if directory
            if (resource.isDirectory())
            {
                if (!pathInContext.endsWith("/") && !pathInContext.equals("/"))
                {
                    log.debug("Redirect to directory/");
                    
                    String q=request.getQuery();
                    StringBuffer buf=request.getRequestURL();
                    if (q!=null&&q.length()!=0)
                    {
                        buf.append('?');
                        buf.append(q);
                    }
                    response.setField(HttpFields.__Location, URI.addPaths(buf.toString(),"/"));
                    response.setStatus(302);
                    request.setHandled(true);
                    return;
                }
  
                // See if index file exists
                String welcome=getHttpContext().getWelcomeFile(resource);
                if (welcome!=null)
                {     
                    // Forward to the index
                    String ipath=URI.addPaths(pathInContext,welcome);
                    if (_redirectWelcomeFiles)
                    {
                        // Redirect to the index
                        ipath=URI.addPaths(getHttpContext().getContextPath(),ipath);
                        response.setContentLength(0);
                        response.sendRedirect(ipath);
                    }
                    else
                    {
                        URI uri=request.getURI();
                        uri.setPath(URI.addPaths(uri.getPath(),welcome));
                        getHttpContext().handle(ipath,pathParams,request,response);
                    }
                    return;
                }

                // Check modified dates
                if (!passConditionalHeaders(request,response,resource))
                    return;
                // If we got here, no forward to index took place
                sendDirectory(request,response,resource,pathInContext.length()>1);
            }
            // check if it is a file
            else if (resource.exists())
            {
                // Check modified dates
                if (!passConditionalHeaders(request,response,resource))
                    return;
                sendData(request,response,pathInContext,resource,true);
            }
            else
                // don't know what it is
                log.warn("Unknown file type");
        }
    }
738077
public void get(String fromPath, String toPath, Status status) {
        http.get(fromPath, redirectRoute(toPath, status));
    }
273753
public static Properties loadClasspath(String path) throws IOException {
		InputStream input = PropUtils.class.getClassLoader().getResourceAsStream(path);
		Properties prop = null;
		try {
			prop = load(input);
		} finally {
			IOUtils.close(input);
		}
		return prop;
	}
934860
public Resource[] getResources(String path) throws IOException {
        if (hasContext()) {
            return context.getResources(path);
        }
        return getContext().getResources(getContextPath() + '/' + path);
    }
1151037
public Response post(String restPath, Object payload, Map<String, String> queryParams) {
		LOG.debug("POST: {}", restPath);
		return call(HttpMethod.POST, restPath, Response.class, payload, queryParams);
	}
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);
        }
    }
1198410
public static InputStream getStream(String path) throws IOException {
    // the other ways to load the stream like
    // "Tools.class.getClass().getResourceAsStream(filename)"
    // don't work in a web context (using Grails):
    InputStream is = Tools.class.getResourceAsStream(path);
    if (is == null) {
      throw new IOException("Could not load file from classpath: '" + path + "'");
    }
    return is;
  }
1286810
protected void doPost(String path) throws ClientException {
        this.readLock.lock();
        try {
            ClientResponse response = getResourceWrapper().rewritten(path, HttpMethod.POST)
                    .post(ClientResponse.class);
            errorIfStatusNotEqualTo(response, ClientResponse.Status.OK, ClientResponse.Status.NO_CONTENT);
            response.close();
        } catch (ClientHandlerException ex) {
            throw new ClientException(ClientResponse.Status.INTERNAL_SERVER_ERROR, ex.getMessage());
        } finally {
            this.readLock.unlock();
        }
    }
1154891
def get(path, params={})
      dont_parse_response = params.delete(:dont_parse_response)

      options = {
        :content_type => :json, 
        :accept => :json, 
        :params => params.merge(:apikey => @api_key, :source => @source)
      }

      RestClient.get("#{@litmosURL}/#{path}", options) do |response, request, result|
        case response.code
        when 200, 201 
          # 200 Success. User/Course etc updated, deleted or retrieved
          # 201 Success. User/Course etc created
          if response.blank?
            true
          else
            if dont_parse_response
              response
            else
              parse_response(response)
            end
          end
        when 404 # 404 Not Found. The User/Course etc that you requested does not exist
          raise NotFound.new(response)

        else
          # 400 Bad Request. Check that your Uri and request body is well formed
          # 403 Forbidden. Check your API key, HTTPS setting, Source parameter etc
          # 409 Conflict. Often occurs when trying to create an item that already exists
          raise ApiError.new(response)

        end        
      end
    end
135944
@Override
    public Enumeration<URL> getResources(final String path) throws IOException {
        final ResourceList resourceList = scanResult.getResourcesWithPath(path);
        if (resourceList == null || resourceList.isEmpty()) {
            return super.getResources(path);
        } else {
            return new Enumeration<URL>() {
                /** The idx. */
                int idx;

                @Override
                public boolean hasMoreElements() {
                    return idx < resourceList.size();
                }

                @Override
                public URL nextElement() {
                    return resourceList.get(idx++).getURL();
                }
            };
        }
    }
962958
public RestResponse get(final String uri, final Map<String, Object> params) throws Exception {
        final String path = getPath(uri);
        final RestResponse response = request(path, HttpGet.METHOD_NAME, params);
        if (response.isError()) {
            throw new IOException(response.getResponseText());
        }
        return response;
    }
1102680
public String post(final String path, final byte[] jsonBytes, final boolean gzip) throws IOException, HttpException {
		Preconditions.checkNotNull(path);
		Preconditions.checkArgument(!path.isEmpty());
		Preconditions.checkNotNull(jsonBytes);
		Preconditions.checkArgument(0 < jsonBytes.length);

		HttpURLConnection connection = null;

		try {
			URL url = new URL(apiConfig.getApiUrl() + path);

			// request properties

			connection = (HttpURLConnection) url.openConnection(proxy);
			connection.setDoInput(true);
			connection.setDoOutput(true);
			connection.setRequestProperty("Content-Type", "application/json");

			if (gzip) {
				connection.setRequestProperty("Content-Encoding", "gzip");
			}

			connection.setRequestProperty("X-Stackify-Key", apiConfig.getApiKey());
			connection.setRequestProperty("X-Stackify-PV", "V1");
			connection.setRequestMethod("POST");
			connection.setConnectTimeout(CONNECT_TIMEOUT);
			connection.setReadTimeout(READ_TIMEOUT);

			// write the post body

			OutputStream stream = null;

			if (gzip) {
				stream = new BufferedOutputStream(new GZIPOutputStream(connection.getOutputStream()));
			} else {
				stream = new BufferedOutputStream(connection.getOutputStream());
			}

			stream.write(jsonBytes);
			stream.flush();
			stream.close();

			// read the response

			int statusCode = connection.getResponseCode();

			if (statusCode != HttpURLConnection.HTTP_OK) {
				throw new HttpException(statusCode);
			}

			return readAndClose(connection.getInputStream());

		} finally {

			if (connection != null) {

				// read and close the input stream

				try {
					readAndClose(connection.getInputStream());
				} catch (Throwable t) {
					// do nothing
				}

				// read and close the error stream

				try {
					readAndClose(connection.getErrorStream());
				} catch (Throwable t) {
					// do nothing
				}
			}
		}
	}
890431
@SuppressWarnings("unchecked")
    @Override
    public T get(final CharSequence path) {
        return (T) get(path, invocationContext.getTargetComponentType());
    }
329888
protected HttpEntity get(HttpClient httpClient, String url) throws IOException {
        logger.debug("Doing GET request on " + url);
        HttpGet get = new HttpGet(url);
        try {
            HttpResponse response = execute(httpClient, get);
            int responseCode = response.getStatusLine().getStatusCode();
            if (responseCode == 404) {
                return null;
            } else if (responseCode != 200) {
                throw new RuntimeException("Unexpected response code (" + responseCode + ") getting " + url);
            }
            return response.getEntity();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
349896
public <T> T get(String restPath, Class<T> expectedResponse, Map<String, String> queryParams) {
		return call(HttpMethod.GET, restPath, expectedResponse, null, queryParams);
	}