@Override public void run() { try { receive(); } catch (IOException ioException) { JOptionPane.showMessageDialog(null, "Problems with a server"); } catch (InterruptedException interruptedException) { JOptionPane.showMessageDialog(null, "Interrupted exception thrown"); } catch (ParserConfigurationException parserException) { parserException.printStackTrace(); } catch (SAXException saxException) { saxException.printStackTrace(); } }
/** * start the parsing * * @param file to parse * @return Vector containing the test cases */ public XMLcpimParser(String fileLocation) { try { SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); saxParser = saxParserFactory.newSAXParser().getXMLReader(); saxParser.setContentHandler(this); saxParser.setFeature("http://xml.org/sax/features/validation", true); // parse the xml specification for the event tags. saxParser.parse(fileLocation); } catch (SAXParseException spe) { spe.printStackTrace(); } catch (SAXException sxe) { sxe.printStackTrace(); } catch (IOException ioe) { // I/O error ioe.printStackTrace(); } catch (Exception pce) { // Parser with specified options can't be built pce.printStackTrace(); } }