private Node getSCPDNode(File scpdFile) throws ParserException { Parser parser = UPnP.getXMLParser(); return parser.parse(scpdFile); }
private Node getSCPDNode(URL scpdUrl) throws ParserException { Parser parser = UPnP.getXMLParser(); return parser.parse(scpdUrl); }
public Node parse(File descriptionFile) throws ParserException { try { InputStream fileIn = new FileInputStream(descriptionFile); Node root = parse(fileIn); fileIn.close(); return root; } catch (Exception e) { throw new ParserException(e); } }
public Node parse(String descr) throws ParserException { try { InputStream decrIn = new ByteArrayInputStream(descr.getBytes()); Node root = parse(decrIn); return root; } catch (Exception e) { throw new ParserException(e); } }
private synchronized Node getRootNode() { if (rootNode != null) return rootNode; try { byte content[] = getContent(); ByteArrayInputStream contentIn = new ByteArrayInputStream(content); Parser parser = SOAP.getXMLParser(); rootNode = parser.parse(contentIn); } catch (ParserException e) { Debug.warning(e); } return rootNode; }
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; }
/** * @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; }
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; }
public SOAPResponse postMessage(String host, int port) { HTTPResponse httpRes = post(host, port); SOAPResponse soapRes = new SOAPResponse(httpRes); byte content[] = soapRes.getContent(); if (content.length <= 0) return soapRes; try { ByteArrayInputStream byteIn = new ByteArrayInputStream(content); Parser xmlParser = SOAP.getXMLParser(); Node rootNode = xmlParser.parse(byteIn); soapRes.setEnvelopeNode(rootNode); } catch (Exception e) { Debug.warning(e); } return soapRes; }
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; }
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; }
/** * @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; }
URL locationUrl = new URL(location); Parser parser = UPnP.getXMLParser(); Node rootNode = parser.parse(locationUrl); Device rootDev = getDevice(rootNode); if (rootDev == null)
private Node getSCPDNode(URL scpdUrl) throws ParserException { Parser parser = UPnP.getXMLParser(); return parser.parse(scpdUrl); }
public Node parse(File descriptionFile) throws ParserException { try { InputStream fileIn = new FileInputStream(descriptionFile); Node root = parse(fileIn); fileIn.close(); return root; } catch (Exception e) { throw new ParserException(e); } }
public Node parse(String descr) throws ParserException { try { InputStream decrIn = new ByteArrayInputStream(descr.getBytes()); Node root = parse(decrIn); return root; } catch (Exception e) { throw new ParserException(e); } }
public Node parse(File descriptionFile) throws ParserException { try { InputStream fileIn = new FileInputStream(descriptionFile); Node root = parse(fileIn); fileIn.close(); return root; } catch (Exception e) { throw new ParserException(e); } }
private Node getSCPDNode(File scpdFile) throws ParserException { Parser parser = UPnP.getXMLParser(); return parser.parse(scpdFile); }
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; }