agave-systems/systems-core/src/main/java/org/iplantc/service/transfer/http/HTTP.java
/**
	 * Makes HTTP get on a remote path using given headers.
	 * @param path
	 * @param mappedHeaders
	 * @return
	 * @throws IOException
	 * @throws RemoteDataException
	 */
Makes HTTP get on a remote path using given headers.
Makes HTTP get on a remote path using given headers .
public CloseableHttpResponse doGet(String path, Map<String, String> mappedHeaders)
	throws IOException, RemoteDataException
	{
		if (StringUtils.isEmpty(path)) {
			throw new IOException("No path to the remote file provided.");
		}
		try 
		{
			URI escapedUri = getUriForPath(path);
			HttpGet httpGet = new HttpGet(escapedUri);
		    if (mappedHeaders != null && !mappedHeaders.isEmpty()) 
		    {
		    	for (String key: mappedHeaders.keySet()) {
		    		httpGet.addHeader(key, mappedHeaders.get(key));
		    	}
		    }
			return doRequest(escapedUri, httpGet);
		}
		catch (IOException e) {
			throw e;
		}
		catch (Exception e) {
			throw new RemoteDataException("Failed to establish output stream to " + path, e);
		}
	}
public CloseableHttpResponse doGet ( String path , Map < String , String > mappedHeaders ) throws IOException , RemoteDataException { if ( StringUtils . isEmpty ( path ) ) { throw new IOException ( "No path to the remote file provided." ) ; } try { URI escapedUri = getUriForPath ( path ) ; HttpGet httpGet = new HttpGet ( escapedUri ) ; if ( mappedHeaders != null && ! mappedHeaders . isEmpty ( ) ) { for ( String key : mappedHeaders . keySet ( ) ) { httpGet . addHeader ( key , mappedHeaders . get ( key ) ) ; } } return doRequest ( escapedUri , httpGet ) ; } catch ( IOException e ) { throw e ; } catch ( Exception e ) { throw new RemoteDataException ( "Failed to establish output stream to " + path , e ) ; } }
Makes HTTP get on a remote path using given headers.
Makes HTTP get on a remote path using given headers .