Package org.cybergarage.upnp.xml

Examples of org.cybergarage.upnp.xml.ServiceData


    try {
      Parser parser = UPnP.getXMLParser();
      Node scpdNode = parser.parse(scpdStr);
      if (scpdNode == null)
        return false;
      ServiceData data = getServiceData();
      data.setSCPDNode(scpdNode);
    }
    catch (ParserException e) {
      throw new InvalidDescriptionException(e);
    }
   
View Full Code Here


    Parser parser = UPnP.getXMLParser();
    Node scpdNode = parser.parse(file);
    if (scpdNode == null)
      return false;
   
    ServiceData data = getServiceData();
    data.setSCPDNode(scpdNode);

    return true;
  }
View Full Code Here

    Parser parser = UPnP.getXMLParser();
    Node scpdNode = parser.parse(input);
    if (scpdNode == null)
      return false;
   
    ServiceData data = getServiceData();
    data.setSCPDNode(scpdNode);
   
    return true;
  }
View Full Code Here

    return parser.parse(scpdFile);
  }

  private Node getSCPDNode()
  {
    ServiceData data = getServiceData();
    Node scpdNode = data.getSCPDNode();
    if (scpdNode != null)
      return scpdNode;
   
    // Thanks for Jaap (Sep 18, 2010)
    Device rootDev = getRootDevice();
    if (rootDev == null)
      return null;
   
    String scpdURLStr = getSCPDURL();

    // Thanks for Robin V. (Sep 18, 2010)
    String rootDevPath = rootDev.getDescriptionFilePath();
    if(rootDevPath!=null) {
      File f;
      f = new File(rootDevPath.concat(scpdURLStr));
   
      if(f.exists()) {
        try {
          scpdNode = getSCPDNode(f);
        } catch (ParserException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
        if(scpdNode!=null) {
          data.setSCPDNode(scpdNode);
          return scpdNode;
        }
      }
    }

    try {
      URL scpdUrl = new URL(rootDev.getAbsoluteURL(scpdURLStr));
      scpdNode = getSCPDNode(scpdUrl);   
      if (scpdNode != null) {
        data.setSCPDNode(scpdNode);
        return scpdNode;
      }
    }
    catch (Exception e) {}
   
View Full Code Here

  ////////////////////////////////////////////////

  private ServiceData getServiceData()
  {
    Node node = getServiceNode();
    ServiceData userData = (ServiceData)node.getUserData();
    if (userData == null) {
      userData = new ServiceData();
      node.setUserData(userData);
      userData.setNode(node);
    }
    return userData;
  }
View Full Code Here

TOP

Related Classes of org.cybergarage.upnp.xml.ServiceData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.