本文整理了Java中org.cybergarage.upnp.Device.getURLBase()
方法的一些代码示例,展示了Device.getURLBase()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Device.getURLBase()
方法的具体详情如下:
包路径:org.cybergarage.upnp.Device
类名称:Device
方法名:getURLBase
暂无
代码示例来源:origin: i2p/i2p.i2p
/**
* @return IP or null
* @since 0.9.34
*/
private static String getIP(Device dev) {
// see ControlRequest.setRequestHost()
String rv = null;
String him = dev.getURLBase();
if (him != null && him.length() > 0) {
try {
URI url = new URI(him);
rv = url.getHost();
} catch (URISyntaxException use) {}
}
if (rv == null) {
him = dev.getLocation();
if (him != null && him.length() > 0) {
try {
URI url = new URI(him);
rv = url.getHost();
} catch (URISyntaxException use) {}
}
}
return rv;
}
代码示例来源:origin: i2p/i2p.i2p
public String getAbsoluteURL(String urlString) {
String baseURLStr = null;
String locationURLStr = null;
Device rootDev = getRootDevice();
if (rootDev != null) {
baseURLStr = rootDev.getURLBase();
locationURLStr = rootDev.getLocation();
}
return getAbsoluteURL(urlString, baseURLStr, locationURLStr);
}
代码示例来源:origin: i2p/i2p.i2p
String urlBase = service.getRootDevice().getURLBase();
if (urlBase != null && 0 < urlBase.length()){
try {
postURL = service.getRootDevice().getURLBase();
代码示例来源:origin: i2p/i2p.i2p
Device dev = service.getDevice();
if (dev != null)
urlBaseStr = dev.getURLBase();
urlBaseStr = rootDev.getURLBase();
代码示例来源:origin: apache/felix
private String resolveRelativeLink(Device device, String link) {
if ( device == null || link == null) return null;
if (link.startsWith("http:"))
return link;
else {
String hostname = "";
String location = "";
String urlBase = device.getURLBase().trim();
//TODO Check if is more important URLBase or location
if (urlBase.equals("")){
location = device.getLocation().trim();
int endHostnameIdx = location.indexOf("/",7);
if (endHostnameIdx!=-1)
hostname=location.substring(0,endHostnameIdx);
else
hostname = location;
if (link.startsWith("/")){
return hostname+link;
}else{
//TODO Check for link start with .. or /
return location +link;
}
}
else {
return urlBase+link;
}
}
}
代码示例来源:origin: org.apache.felix/org.apache.felix.upnp.basedriver
private String resolveRelativeLink(Device device, String link) {
if ( device == null || link == null) return null;
if (link.startsWith("http:"))
return link;
else {
String hostname = "";
String location = "";
String urlBase = device.getURLBase().trim();
//TODO Check if is more important URLBase or location
if (urlBase.equals("")){
location = device.getLocation().trim();
int endHostnameIdx = location.indexOf("/",7);
if (endHostnameIdx!=-1)
hostname=location.substring(0,endHostnameIdx);
else
hostname = location;
if (link.startsWith("/")){
return hostname+link;
}else{
//TODO Check for link start with .. or /
return location +link;
}
}
else {
return urlBase+link;
}
}
}
代码示例来源:origin: cybergarage/cybergarage-upnp
public String getAbsoluteURL(String urlString) {
String baseURLStr = null;
String locationURLStr = null;
Device rootDev = getRootDevice();
if (rootDev != null) {
baseURLStr = rootDev.getURLBase();
locationURLStr = rootDev.getLocation();
}
return getAbsoluteURL(urlString, baseURLStr, locationURLStr);
}
代码示例来源:origin: geniusgithub/MediaPlayer
String urlBaseStr = rootDev.getURLBase();
代码示例来源:origin: geniusgithub/MediaPlayer
String urlBase = service.getRootDevice().getURLBase();
if (urlBase != null && 0 < urlBase.length()){
try {
postURL = service.getRootDevice().getURLBase();
代码示例来源:origin: cybergarage/cybergarage-upnp
String urlBase = service.getRootDevice().getURLBase();
if (urlBase != null && 0 < urlBase.length()){
try {
postURL = service.getRootDevice().getURLBase();
代码示例来源:origin: cybergarage/cybergarage-upnp
void set(Device dev)
{
if (dev.isRootDevice() == true) {
addRow("Location", dev.getLocation());
addRow("URLBase", dev.getURLBase());
addRow("LeaseTime", Long.toString(dev.getLeaseTime()));
}
set(dev.getDeviceNode());
}
}
代码示例来源:origin: cybergarage/cybergarage-upnp
Device dev = service.getDevice();
if (dev != null)
urlBaseStr = dev.getURLBase();
urlBaseStr = rootDev.getURLBase();
代码示例来源:origin: geniusgithub/MediaPlayer
Device dev = service.getDevice();
if (dev != null)
urlBaseStr = dev.getURLBase();
urlBaseStr = rootDev.getURLBase();
内容来源于网络,如有侵权,请联系作者删除!