use of org.cybergarage.upnp.device.InvalidDescriptionException in project i2p.i2p by i2p.
the class Device method loadDescription.
public boolean loadDescription(File file) throws InvalidDescriptionException {
try {
Parser parser = UPnP.getXMLParser();
rootNode = parser.parse(file);
if (rootNode == null)
throw new InvalidDescriptionException(Description.NOROOT_EXCEPTION, file);
deviceNode = rootNode.getNode(Device.ELEM_NAME);
if (deviceNode == null)
throw new InvalidDescriptionException(Description.NOROOTDEVICE_EXCEPTION, file);
} catch (ParserException e) {
throw new InvalidDescriptionException(e);
}
if (initializeLoadedDescription() == false)
return false;
setDescriptionFile(file);
return true;
}
use of org.cybergarage.upnp.device.InvalidDescriptionException in project i2p.i2p by i2p.
the class Device method loadDescription.
/**
* @since 1.8.0
*/
public boolean loadDescription(InputStream input) throws InvalidDescriptionException {
try {
Parser parser = UPnP.getXMLParser();
rootNode = parser.parse(input);
if (rootNode == null)
throw new InvalidDescriptionException(Description.NOROOT_EXCEPTION);
deviceNode = rootNode.getNode(Device.ELEM_NAME);
if (deviceNode == null)
throw new InvalidDescriptionException(Description.NOROOTDEVICE_EXCEPTION);
} catch (ParserException e) {
throw new InvalidDescriptionException(e);
}
if (initializeLoadedDescription() == false)
return false;
setDescriptionFile(null);
return true;
}
use of org.cybergarage.upnp.device.InvalidDescriptionException in project i2p.i2p by i2p.
the class Device method loadDescription.
public boolean loadDescription(String descString) throws InvalidDescriptionException {
try {
Parser parser = UPnP.getXMLParser();
rootNode = parser.parse(descString);
if (rootNode == null)
throw new InvalidDescriptionException(Description.NOROOT_EXCEPTION);
deviceNode = rootNode.getNode(Device.ELEM_NAME);
if (deviceNode == null)
throw new InvalidDescriptionException(Description.NOROOTDEVICE_EXCEPTION);
} catch (ParserException e) {
throw new InvalidDescriptionException(e);
}
if (initializeLoadedDescription() == false)
return false;
setDescriptionFile(null);
return true;
}
use of org.cybergarage.upnp.device.InvalidDescriptionException 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