Code example for HttpResponse

Methods: getHeaders, getStatusLine

0
	    HttpContext context = new BasicHttpContext();
 
	    HttpResponse response = httpClient.execute(httpget, context);
 
	    // If we didn't get a '302 Found' we aren't being redirected. 
	    if (response.getStatusLine().getStatusCode() != HttpStatus.SC_MOVED_TEMPORARILY)
	        throw new IOException(response.getStatusLine().toString());
 
	    org.apache.http.Header[] loc = response.getHeaders("Location");
	    return loc.length > 0 ? loc[0].getValue() : null;
	} 
	 
	public String getFileDownloadUrl(int id) {
		return baseUrl + "files/" + id + "/download" + tokenWithStuff;
	} 
	 
	public static boolean idIsDownloaded(int id) {
		String path = Environment.getExternalStoragePublicDirectory(
				Environment.DIRECTORY_DOWNLOADS).getAbsolutePath()
				+ File.separator + "put.io" + File.separator + id;
		File file = new File(path);