/** * Create a new RuntimeException, setting the cause if possible. * @param message * @param cause * @return A runtime exception object. */ public static RuntimeException createRuntimeException( String message, Throwable cause) { return (RuntimeException) createWithCause( RuntimeException.class, message, cause); }
/** * Create a new RuntimeException, setting the cause if possible. * @param message * @param cause * @return A runtime exception object. */ public static RuntimeException createRuntimeException( String message, Throwable cause) { return (RuntimeException) createWithCause( RuntimeException.class, message, cause); }
@Override public InputStream getResourceStream(String name) throws ResourceNotFoundException { InputStream result = null; if (StringUtils.isEmpty(name)) { throw new ResourceNotFoundException("No template name provided"); } String path = base + name; try { result = ClassUtils.getResourceAsStream(getClass(), path); } catch (Exception fnfe) { throw (ResourceNotFoundException) ExceptionUtils.createWithCause( ResourceNotFoundException.class, "problem with template: " + path, fnfe); } if (result == null) { throw new ResourceNotFoundException("ClasspathResourceLoader Error: cannot find resource " + path); } return result; }
throw (ResourceNotFoundException) ExceptionUtils.createWithCause(ResourceNotFoundException.class, "problem with template: " + name, fnfe );
throw (ResourceNotFoundException) ExceptionUtils.createWithCause(ResourceNotFoundException.class, "problem with template: " + name, fnfe );