protected Document responseToDoc ( String response ) { Document doc = null ; try { DocumentBuilderFactory factory = new DocumentBuilderFactoryImpl ( ) ; DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder builder = factory . newDocumentBuilder ( ) ; ByteArrayInputStream input = new ByteArrayInputStream ( response . getBytes ( "UTF-8" ) ) ; doc = builder . parse ( input ) ; } catch ( ParserConfigurationException e ) { LOG . error ( "ParserConfigurationException" , e ) ; } catch ( UnsupportedEncodingException e ) { LOG . error ( "UnsupportedEncodingException" , e ) ; } catch ( IOException e ) { LOG . error ( "IOException" , e ) ; } catch ( SAXException e ) { LOG . error ( "SAXException" , e ) ; } return doc ; }
Converts String response into document for parsing