network_interface = _network_interface;
local_address = _local_address;
usn = _usn;
location = _location;
SimpleXMLParserDocument doc = upnp.downloadXML( this, location );
SimpleXMLParserDocumentNode url_base_node = doc.getChild("URLBase");
try{
if ( url_base_node != null ){
String url_str = url_base_node.getValue().trim();
// url_str is sometimes blank
if ( url_str.length() > 0 ){
url_base_for_relative_urls = new URL(url_str);
}
}
upnp.log( "Relative URL base is " + (url_base_for_relative_urls==null?"unspecified":url_base_for_relative_urls.toString()));
}catch( MalformedURLException e ){
upnp.log( "Invalid URLBase - " + (url_base_node==null?"mill":url_base_node.getValue()));
upnp.log( e );
Debug.printStackTrace( e );
}
SimpleXMLParserDocumentNode device = doc.getChild( "Device" );
if ( device == null ){
throw( new UPnPException( "Root device '" + usn + "(" + location + ") is missing the device description" ));
}