Code example for URL

Methods: getContent

0
	public static final String LOG_TAG=FileUtil.class.getName();
    public static final String CACHELOCATION = "/data/data/org.fosdem/files/";  // TODO eMich - get cachelocation from Android environment
 
	public static Object fetch(String address) throws MalformedURLException,
			IOException { 
		URL url = new URL(address);
		Object content = url.getContent();
		return content;
	} 
 
	public static Object fetchCached(String address)
			throws MalformedURLException, IOException { 
		return fetchCached(address, -1);
	} 
 
	public static Object fetchCached(String address, int hours)
			throws MalformedURLException, IOException { 
		String cacheName = md5(address);
		checkAndCreateDirectoryIfNeeded(); 
 
		File r = new File(CACHELOCATION + cacheName);