Changeset 1521 for MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/SRUAction.java
- Timestamp:
- 09/06/11 13:04:37 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/SRUAction.java
r1512 r1521 29 29 30 30 import eu.clarin.cmdi.mdservice.internal.Cache; 31 import eu.clarin.cmdi.mdservice.internal.Helpers; 31 32 32 33 … … 402 403 } 403 404 404 public static Document newDocumentFromInputStream(InputStream in) { 405 DocumentBuilderFactory factory = null; 406 DocumentBuilder builder = null; 407 Document ret = null; 408 409 try { 410 factory = DocumentBuilderFactory.newInstance(); 411 builder = factory.newDocumentBuilder(); 412 } catch (ParserConfigurationException e) { 413 e.printStackTrace(); 414 } 415 416 try { 417 ret = builder.parse(new InputSource(in)); 418 } catch (SAXException e) { 419 e.printStackTrace(); 420 } catch (IOException e) { 421 e.printStackTrace(); 422 } 423 return ret; 424 } 425 405 426 406 427 407 public void postprocess() throws TransformerConfigurationException, UnsupportedEncodingException, ParserConfigurationException, TransformerException, TransformerFactoryConfigurationError{ … … 443 423 // add diagnostics 444 424 if (getDiagnostics().Exists()){ 445 Document doc = newDocumentFromInputStream(this.getResultStream());425 Document doc = Helpers.getDocument(this.getResultStream()); 446 426 Node r_element= doc.getElementsByTagName("searchRetrieveResponse").item(0); 447 427 Document ddoc = getDiagnostics().buildXMLDocument();
Note: See TracChangeset
for help on using the changeset viewer.