use of org.cybergarage.upnp.xml.ServiceData in project i2p.i2p by i2p.
the class Service method getSCPDNode.
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();
try {
URL scpdUrl = new URL(rootDev.getAbsoluteURL(scpdURLStr));
scpdNode = getSCPDNode(scpdUrl);
if (scpdNode != null) {
data.setSCPDNode(scpdNode);
return scpdNode;
}
} catch (Exception e) {
// I2P
Debug.warning(e);
}
return null;
}
use of org.cybergarage.upnp.xml.ServiceData in project i2p.i2p by i2p.
the class Service method loadSCPD.
/**
* @since 1.8.0
*/
public boolean loadSCPD(InputStream input) throws ParserException {
Parser parser = UPnP.getXMLParser();
Node scpdNode = parser.parse(input);
if (scpdNode == null)
return false;
ServiceData data = getServiceData();
data.setSCPDNode(scpdNode);
return true;
}
use of org.cybergarage.upnp.xml.ServiceData in project i2p.i2p by i2p.
the class Service method getServiceData.
// //////////////////////////////////////////////
// UserData
// //////////////////////////////////////////////
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;
}
use of org.cybergarage.upnp.xml.ServiceData in project i2p.i2p by i2p.
the class Service method loadSCPD.
public boolean loadSCPD(File file) throws ParserException {
Parser parser = UPnP.getXMLParser();
Node scpdNode = parser.parse(file);
if (scpdNode == null)
return false;
ServiceData data = getServiceData();
data.setSCPDNode(scpdNode);
return true;
}
use of org.cybergarage.upnp.xml.ServiceData in project i2p.i2p by i2p.
the class Service method loadSCPD.
// //////////////////////////////////////////////
// SCPD node
// //////////////////////////////////////////////
public boolean loadSCPD(String scpdStr) throws InvalidDescriptionException {
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);
}
return true;
}
Aggregations