org.cybergarage.upnp.Device.getLocation()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(178)

本文整理了Java中org.cybergarage.upnp.Device.getLocation()方法的一些代码示例,展示了Device.getLocation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Device.getLocation()方法的具体详情如下:
包路径:org.cybergarage.upnp.Device
类名称:Device
方法名:getLocation

Device.getLocation介绍

暂无

代码示例

代码示例来源: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 location = rootDev.getLocation();
String locationHost = HTTP.getHost(location);
int locationPort = HTTP.getPort(location);

代码示例来源:origin: i2p/i2p.i2p

postURL = service.getRootDevice().getLocation();

代码示例来源:origin: i2p/i2p.i2p

Device rootDev = service.getRootDevice();
if (rootDev != null)
  urlBaseStr = rootDev.getLocation();

代码示例来源:origin: geniusgithub/MediaPlayer

public String getHost(){
    String location = getLocation();
    if (location !=  null){
      return HTTP.getHost(location);
    }

    return "";
  }
/*    public String getAbsoluteURL(String urlString) {

代码示例来源:origin: geniusgithub/MediaPlayer

public void update(Device device){
    mTVManuFacture.setText(device.getManufacture());
    mTVModelName.setText(device.getModelName());
    mTVModelDescription.setText(device.getModelDescription());
    mTVLocation.setText(device.getLocation());
    mTVUDN.setText(device.getUDN());
  }
}

代码示例来源: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: org.apache.felix/org.apache.felix.upnp.basedriver

public String getLocationURL(String udn) {
  if (myCtrl == null){
    logger.WARNING("UPnP Importer is disabled. getLocationURL is not available");
    return null;
  }
  if (udn == null || udn.equals(""))  throw new IllegalArgumentException("Invalid udn paramenter");
  Device device = myCtrl.getDevice(udn);
  if (device == null) {
    logger.WARNING("getLocationURL():: No device data available for UDN:"+udn);
    return null;
  }
  return device.getLocation();
}

代码示例来源:origin: apache/felix

public String getLocationURL(String udn) {
  if (myCtrl == null){
    logger.WARNING("UPnP Importer is disabled. getLocationURL is not available");
    return null;
  }
  if (udn == null || udn.equals(""))  throw new IllegalArgumentException("Invalid udn paramenter");
  Device device = myCtrl.getDevice(udn);
  if (device == null) {
    logger.WARNING("getLocationURL():: No device data available for UDN:"+udn);
    return null;
  }
  return device.getLocation();
}

代码示例来源:origin: apache/felix

public InputStream getInputStream() throws IOException {
  String urlString=ParseLocation.getUrlBase(cyberdev.getLocation())+icon.getURL();
  URL url=new URL(urlString);
  HTTPRequestForIcon requestor=new HTTPRequestForIcon(url);
  
  return requestor.getInputStream();
}

代码示例来源: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: org.apache.felix/org.apache.felix.upnp.basedriver

public InputStream getInputStream() throws IOException {
  String urlString=ParseLocation.getUrlBase(cyberdev.getLocation())+icon.getURL();
  URL url=new URL(urlString);
  HTTPRequestForIcon requestor=new HTTPRequestForIcon(url);
  
  return requestor.getInputStream();
}

代码示例来源:origin: geniusgithub/MediaPlayer

String location = rootDev.getLocation();
String locationHost = HTTP.getHost(location);
int locationPort = HTTP.getPort(location);

代码示例来源: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: geniusgithub/MediaPlayer

postURL = service.getRootDevice().getLocation();

代码示例来源:origin: cybergarage/cybergarage-upnp

postURL = service.getRootDevice().getLocation();

代码示例来源:origin: cybergarage/cybergarage-upnp

Device rootDev = service.getRootDevice();
if (rootDev != null)
  urlBaseStr = rootDev.getLocation();

代码示例来源:origin: geniusgithub/MediaPlayer

Device rootDev = service.getRootDevice();
if (rootDev != null)
  urlBaseStr = rootDev.getLocation();

相关文章

Device类方法