Code example for URLConnection

Methods: getInputStream, x 1

1
	} 
 
	public Structure load(URL url) throws IOException
	{ 
		URLConnection urlConnection = url.openConnection();
        urlConnection.addRequestProperty("User-agent", "Mozilla/4.0 (compatible; MSIE 6.0;Windows NT 5.1; SV1)");
		InputStream inputStream = urlConnection.getInputStream();
		parseXMLFile(url.getFile(), inputStream);
		return handler.getStructure();
	} 
	 
	public Structure load(String dataset, InputStream is)
	{ 
		parseXMLFile(dataset, is);
		return handler.getStructure();
	} 
 
	public boolean canLoad(String name) 
	{ 
		return false; 
	}