public URL normalizeURI(URI relativeOrAbsoluteURI) { // TODO: I have one device (Netgear 834DG DSL Router) that sends a <URLBase>, and even that is wrong (port)! // This can be fixed by "re-enabling" UPnP in the upnpService after a reboot, it will then use the right port... // return URIUtil.createAbsoluteURL(getDescriptorURL(), relativeOrAbsoluteURI); if (getDetails() != null && getDetails().getBaseURL() != null) { // If we have an <URLBase>, all URIs are relative to it return URIUtil.createAbsoluteURL(getDetails().getBaseURL(), relativeOrAbsoluteURI); } else { // Otherwise, they are relative to the descriptor location return URIUtil.createAbsoluteURL(getIdentity().getDescriptorURL(), relativeOrAbsoluteURI); } }
public static boolean isLocalIpAddress(Device device) { try { String addrip = device.getDetails().getBaseURL().toString(); addrip = addrip.substring("http://".length(), addrip.length()); addrip = addrip.substring(0, addrip.indexOf(":")); boolean ret = isLocalIpAddress(addrip); ret = false; return ret; } catch (Exception e) { e.printStackTrace(); } return false; }
public URL normalizeURI(URI relativeOrAbsoluteURI) { // TODO: I have one device (Netgear 834DG DSL Router) that sends a <URLBase>, and even that is wrong (port)! // This can be fixed by "re-enabling" UPnP in the upnpService after a reboot, it will then use the right port... // return URIUtil.createAbsoluteURL(getDescriptorURL(), relativeOrAbsoluteURI); if (getDetails() != null && getDetails().getBaseURL() != null) { // If we have an <URLBase>, all URIs are relative to it return URIUtil.createAbsoluteURL(getDetails().getBaseURL(), relativeOrAbsoluteURI); } else { // Otherwise, they are relative to the descriptor location return URIUtil.createAbsoluteURL(getIdentity().getDescriptorURL(), relativeOrAbsoluteURI); } }
@Override public String getXMLURL() { try { return device.getDetails().getBaseURL().toString(); } catch (Exception e) { return ""; } }
@Override public String getXMLURL() { try { return device.getDetails().getBaseURL().toString(); } catch (Exception e) { return ""; } }
@Override public void logRouterInfo() throws RouterException { final RemoteDevice device = service.getDevice(); final UDAVersion version = device.getVersion(); final DeviceDetails deviceDetails = device.getDetails(); logger.info("Service id: {}", service.getServiceId()); logger.info("Reference: {}", service.getReference()); logger.info("Display name: {}", device.getDisplayString()); logger.info("Version: {}.{}", version.getMajor(), version.getMinor()); logger.info("Control uri: {}", service.getControlURI()); logger.info("Descriptor uri: {}", service.getDescriptorURI()); logger.info("Event subscription uri: {}", service.getEventSubscriptionURI()); logger.info("Device base url: {}", deviceDetails.getBaseURL()); logger.info("Device presentation uri: {}", deviceDetails.getPresentationURI()); }
public URL normalizeURI(URI relativeOrAbsoluteURI) { // TODO: I have one device (Netgear 834DG DSL Router) that sends a <URLBase>, and even that is wrong (port)! // This can be fixed by "re-enabling" UPnP in the upnpService after a reboot, it will then use the right port... // return URIUtil.createAbsoluteURL(getDescriptorURL(), relativeOrAbsoluteURI); if (getDetails() != null && getDetails().getBaseURL() != null) { // If we have an <URLBase>, all URIs are relative to it return URIUtil.createAbsoluteURL(getDetails().getBaseURL(), relativeOrAbsoluteURI); } else { // Otherwise, they are relative to the descriptor location return URIUtil.createAbsoluteURL(getIdentity().getDescriptorURL(), relativeOrAbsoluteURI); } }
final ModelDetails modelDetails = details.getModelDetails(); log.info("New service discovered: {}", remoteService); log.info(">>>> baseURL: {}", details.getBaseURL()); log.info(">>>> DLNA caps: {}", details.getDlnaCaps()); log.info(">>>> DLNA docs: {}", Arrays.toString(details.getDlnaDocs()));