@Override public HierarchicalStreamReader createReader(Reader in) { return xppDriver.createReader(in); }
@Override public HierarchicalStreamReader createReader(InputStream in) { return xppDriver.createReader(in); }
@Override public HierarchicalStreamReader createReader(URL in) { return xppDriver.createReader(in); }
@Override public HierarchicalStreamReader createReader(File in) { return xppDriver.createReader(in); }
@Override public HierarchicalStreamReader createReader(InputStream in) { return xppDriver.createReader(in); }
@Override public HierarchicalStreamReader createReader(Reader in) { return xppDriver.createReader(in); }
@Override public HierarchicalStreamReader createReader(File in) { return xppDriver.createReader(in); }
@Override public HierarchicalStreamReader createReader(InputStream in) { return xppDriver.createReader(in); }
@Override public HierarchicalStreamReader createReader(Reader in) { return xppDriver.createReader(in); }
@Override public HierarchicalStreamReader createReader(URL in) { return xppDriver.createReader(in); }
@Override public HierarchicalStreamReader createReader(File in) { return xppDriver.createReader(in); }
@Override public HierarchicalStreamReader createReader(URL in) { return xppDriver.createReader(in); }
protected static HierarchicalStreamReader safeXmlStreamReader(Source source) throws IOException { final StringWriter out = new StringWriter(); try { XMLUtils.safeTransform(source, new StreamResult(out)); out.close(); } catch (TransformerException e) { throw new IOException("Failed to parse", e); } catch (SAXException e) { throw new IOException("Failed to parse", e); } return new XppDriver().createReader(new StringReader(out.toString())); } }
protected static HierarchicalStreamReader safeXmlStreamReader(Source source) throws IOException { final StringWriter out = new StringWriter(); try { XMLUtils.safeTransform(source, new StreamResult(out)); out.close(); } catch (TransformerException e) { throw new IOException("Failed to parse", e); } catch (SAXException e) { throw new IOException("Failed to parse", e); } return new XppDriver().createReader(new StringReader(out.toString())); } }
public HierarchicalStreamReader createReader(InputStream in) { try { return createReader(new XmlHeaderAwareReader(in)); } catch (UnsupportedEncodingException e) { throw new StreamException(e); } catch (IOException e) { throw new StreamException(e); } }
public HierarchicalStreamReader createReader(InputStream in) { try { return createReader(new XmlHeaderAwareReader(in)); } catch (UnsupportedEncodingException e) { throw new StreamException(e); } catch (IOException e) { throw new StreamException(e); } }
/** * Updates a {@link Credentials} by its XML definition. * * @param source source of the Item's new definition. * The source should be either a <code>StreamSource</code> or a <code>SAXSource</code>, other * sources may not be handled. * @throws IOException if things go wrong. * @since 2.1.1 */ @Restricted(NoExternalUse.class) public void updateByXml(Source source) throws IOException { getStore().checkPermission(CredentialsProvider.MANAGE_DOMAINS); final StringWriter out = new StringWriter(); try { XMLUtils.safeTransform(source, new StreamResult(out)); out.close(); } catch (TransformerException e) { throw new IOException("Failed to parse credential", e); } catch (SAXException e) { throw new IOException("Failed to parse credential", e); } Domain replacement = (Domain) Items.XSTREAM.unmarshal(new XppDriver().createReader(new StringReader(out.toString()))); getStore().updateDomain(domain, replacement); }
/** * Updates a {@link Credentials} by its XML definition. * * @param source source of the Item's new definition. * The source should be either a <code>StreamSource</code> or a <code>SAXSource</code>, other * sources may not be handled. * @throws IOException if things go wrong * @since 2.1.1 */ @Restricted(NoExternalUse.class) public void updateByXml(Source source) throws IOException { getStore().checkPermission(UPDATE); final StringWriter out = new StringWriter(); try { XMLUtils.safeTransform(source, new StreamResult(out)); out.close(); } catch (TransformerException e) { throw new IOException("Failed to parse credential", e); } catch (SAXException e) { throw new IOException("Failed to parse credential", e); } Credentials credentials = (Credentials) Items.XSTREAM.unmarshal(new XppDriver().createReader(new StringReader(out.toString()))); getStore().updateCredentials(domain.getDomain(), this.credentials, credentials); }
/** * Updates a {@link Credentials} by its XML definition. * * @param source source of the Item's new definition. * The source should be either a <code>StreamSource</code> or a <code>SAXSource</code>, other * sources may not be handled. * @throws IOException if things go wrong * @since 2.1.1 */ @Restricted(NoExternalUse.class) public void updateByXml(Source source) throws IOException { getStore().checkPermission(UPDATE); final StringWriter out = new StringWriter(); try { XMLUtils.safeTransform(source, new StreamResult(out)); out.close(); } catch (TransformerException e) { throw new IOException("Failed to parse credential", e); } catch (SAXException e) { throw new IOException("Failed to parse credential", e); } Credentials credentials = (Credentials) Items.XSTREAM.unmarshal(new XppDriver().createReader(new StringReader(out.toString()))); getStore().updateCredentials(domain.getDomain(), this.credentials, credentials); }
/** * Read results from JTL file. * * @param reader of the file * @param resultCollectorHelper helper class to enable TestResultWrapperConverter to deliver the samples * @throws IOException if an I/O error occurs */ public static void loadTestResults(InputStream reader, ResultCollectorHelper resultCollectorHelper) throws IOException { // Get the InputReader to use InputStreamReader inputStreamReader = getInputStreamReader(reader); DataHolder dh = JTLSAVER.newDataHolder(); dh.put(RESULTCOLLECTOR_HELPER_OBJECT, resultCollectorHelper); // Allow TestResultWrapper to feed back the samples // This is effectively the same as saver.fromXML(InputStream) except we get to provide the DataHolder // Don't know why there is no method for this in the XStream class JTLSAVER.unmarshal(new XppDriver().createReader(reader), null, dh); inputStreamReader.close(); }