private static void throwInvalidCompositeRuleName(final String compositRuleName) { throw new SmooksException("A rule must be specified in the format <ruleProviderName>.<ruleName>." + " Please check you configuration and make sure that you are referencing the rule in a correct manner."); }
private static URL systemIdToURL(final String systemId) { try { return new URL(systemId); } catch (MalformedURLException e) { throw new SmooksException("Invalid System ID on StreamSource: '" + systemId + "'. Must be a valid URL.", e); } }
public void replay(ContentHandler handler) throws SmooksException { try { handler.endElement(uri, localName, qName); } catch (SAXException e) { throw new SmooksException("Error replaying endElement event.", e); } } }
public void replay(ContentHandler handler) throws SmooksException { try { handler.startElement(uri, localName, qName, atts); } catch (SAXException e) { throw new SmooksException("Error replaying startElement event.", e); } } }
public void replay(ContentHandler handler) throws SmooksException { try { handler.endElement(uri, localName, qName); } catch (SAXException e) { throw new SmooksException("Error replaying endElement event.", e); } } }
public void replay(ContentHandler handler) throws SmooksException { try { handler.startElement(uri, localName, qName, atts); } catch (SAXException e) { throw new SmooksException("Error replaying startElement event.", e); } } }
public void replay(ContentHandler handler) throws SmooksException { try { handler.endElement(uri, localName, qName); } catch (SAXException e) { throw new SmooksException("Error replaying endElement event.", e); } } }
private static URL systemIdToURL(final String systemId) { try { return new URL(systemId); } catch (MalformedURLException e) { throw new SmooksException("Invalid System ID on StreamSource: '" + systemId + "'. Must be a valid URL.", e); } }
public void replay(ContentHandler handler) throws SmooksException { try { handler.startElement(uri, localName, qName, atts); } catch (SAXException e) { throw new SmooksException("Error replaying startElement event.", e); } } }
public void replay(ContentHandler handler) throws SmooksException { try { handler.endElement(uri, localName, qName); } catch (SAXException e) { throw new SmooksException("Error replaying endElement event.", e); } } }
public void apply(Object contextObject, Writer outputWriter) { try { template.process(contextObject, outputWriter); } catch (TemplateException e) { throw new SmooksException("Failed to apply template.", e); } catch (IOException e) { throw new IllegalStateException("Unexpected IOException.", e); } }
private static Reader streamToReader(InputStream inputStream, String contentEncoding) { try { if (contentEncoding != null) { return new InputStreamReader(inputStream, contentEncoding); } else { return new InputStreamReader(inputStream, "UTF-8"); } } catch (UnsupportedEncodingException e) { throw new SmooksException("Unable to decode input stream.", e); } }
public void apply(Object contextObject, Writer outputWriter) { try { template.process(contextObject, outputWriter); } catch (TemplateException e) { throw new SmooksException("Failed to apply template.", e); } catch (IOException e) { throw new IllegalStateException("Unexpected IOException.", e); } }
private static Reader streamToReader(InputStream inputStream, String contentEncoding) { try { if (contentEncoding != null) { return new InputStreamReader(inputStream, contentEncoding); } else { return new InputStreamReader(inputStream, "UTF-8"); } } catch (UnsupportedEncodingException e) { throw new SmooksException("Unable to decode input stream.", e); } }
public void apply(Object contextObject, Writer outputWriter) { try { template.process(contextObject, outputWriter); } catch (TemplateException e) { throw new SmooksException("Failed to apply template.", e); } catch (IOException e) { throw new IllegalStateException("Unexpected IOException.", e); } }
private static Reader streamToReader(InputStream inputStream, String contentEncoding) { try { if (contentEncoding != null) { return new InputStreamReader(inputStream, contentEncoding); } else { return new InputStreamReader(inputStream, "UTF-8"); } } catch (UnsupportedEncodingException e) { throw new SmooksException("Unable to decode input stream.", e); } }
private void createTempDir() { if (tmpDir == null) { try { File tmpFile = File.createTempFile("tmp", "tmp"); tmpFile.delete(); tmpDir = new File(tmpFile.getParentFile(), UUID.randomUUID().toString()); DeleteOnExitHook.add(tmpDir); } catch (IOException e) { throw new SmooksException("Unable to crete temp directory for archive.", e); } } }
private void createTempDir() { if (tmpDir == null) { try { File tmpFile = File.createTempFile("tmp", "tmp"); tmpFile.delete(); tmpDir = new File(tmpFile.getParentFile(), UUID.randomUUID().toString()); DeleteOnExitHook.add(tmpDir); } catch (IOException e) { throw new SmooksException("Unable to crete temp directory for archive.", e); } } }
private void createTempDir() { if (tmpDir == null) { try { File tmpFile = File.createTempFile("tmp", "tmp"); tmpFile.delete(); tmpDir = new File(tmpFile.getParentFile(), UUID.randomUUID().toString()); DeleteOnExitHook.add(tmpDir); } catch (IOException e) { throw new SmooksException("Unable to crete temp directory for archive.", e); } } }
private static InputStream systemIdToStream(String systemId) { try { return systemIdToURL(systemId).openStream(); } catch (IOException e) { throw new SmooksException("Invalid System ID on StreamSource: '" + systemId + "'. Unable to open stream to resource.", e); } }