Example usage for org.apache.commons.lang UnhandledException UnhandledException

List of usage examples for org.apache.commons.lang UnhandledException UnhandledException

Introduction

In this page you can find the example usage for org.apache.commons.lang UnhandledException UnhandledException.

Prototype

public UnhandledException(Throwable cause) 

Source Link

Document

Constructs the exception using a cause.

Usage

From source file:hr.fer.zemris.vhdllab.util.IOUtil.java

public static String toString(InputStream is) {
    try {/*from  ww  w  .  ja  v  a  2 s  .  co m*/
        return org.apache.commons.io.IOUtils.toString(is, DEFAULT_ENCODING);
    } catch (IOException e) {
        throw new UnhandledException(e);
    }
}

From source file:ar.com.zauber.garfio.modules.common.utils.NotificationAddressFactoryUtil.java

/** @return a new instance of JavaEmailNotificationFactory */
public static NotificationAddressFactory createJavaEmailNotificationFactory() {
    try {/* ww  w . j  av a2  s .  c o m*/
        return (NotificationAddressFactory) Class
                .forName("ar.com.zauber.commons.message.impl.mail." + "JavaMailEmailAddressFactory")
                .newInstance();
    } catch (final InstantiationException e) {
        throw new UnhandledException(e);
    } catch (final IllegalAccessException e) {
        throw new UnhandledException(e);
    } catch (final ClassNotFoundException e) {
        throw new UnhandledException(e);
    }
}

From source file:com.antsdb.saltedfish.sql.vdm.ExprUtil.java

/**
 * <p>Unescapes any Java literals found in the <code>String</code>.
 * For example, it will turn a sequence of <code>'\'</code> and
 * <code>'n'</code> into a newline character, unless the <code>'\'</code>
 * is preceded by another <code>'\'</code>.</p>
 * //  w ww  .  jav a  2 s  .c  o  m
 * @param str  the <code>String</code> to unescape, may be null
 * @return a new unescaped <code>String</code>, <code>null</code> if null string input
 */
public static String unescape(String str) {
    if (str == null) {
        return null;
    }
    try {
        StringWriter writer = new StringWriter(str.length());
        unescapeJava(writer, str);
        return writer.toString();
    } catch (IOException ioe) {
        // this should never ever happen while writing to a StringWriter
        throw new UnhandledException(ioe);
    }

}

From source file:ar.com.zauber.commons.dao.closure.FatalClosure.java

public void execute(T t) {
    throw new UnhandledException(e);
}

From source file:gov.nih.nci.caarray.application.file.DirectJobSubmitter.java

private TextMessage getMessageStub(String messageText) {
    TextMessage message = mock(TextMessage.class);
    try {// w  w w.  j  a v a 2  s .  c  om
        when(message.getText()).thenReturn(messageText);
    } catch (JMSException e) {
        throw new UnhandledException(e);
    }
    return message;
}

From source file:ar.com.zauber.labs.kraken.providers.wikipedia.apps.administrative.TabSeparatedWriter.java

/** writes a line */
public final void write(final CharSequence... fields) {
    try {/*www.  jav  a 2  s . c  om*/
        for (final CharSequence field : fields) {
            writer.append(field);
            writer.append('\t');
        }
        writer.append('\n');
        writer.flush();
    } catch (final IOException e) {
        throw new UnhandledException(e);
    }
}

From source file:ar.com.zauber.commons.web.proxy.transformers.NullContentTransformer.java

/** @see OutputTransformer#transform(InputStream, OutputStream) */
public final void transform(final InputStream is, final OutputStream os, final ContentMetadata metadata) {
    try {//from w w w  . j  ava  2s .com
        IOUtils.copy(is, os);
    } catch (final IOException e) {
        throw new UnhandledException(e);
    }
}

From source file:ar.com.zauber.commons.dao.closure.ErrorLoggerWrapperClosure.java

/** Creates the WrapperClosure. */
public ErrorLoggerWrapperClosure(final Closure<T> target) {
    this(target, new Closure<Throwable>() {
        private final Logger logger = LoggerFactory.getLogger(ErrorLoggerWrapperClosure.class);

        public void execute(final Throwable e) {
            logger.error("processing closure", e);
            throw new UnhandledException(e);
        }//from w w  w. j av  a2s.c  o  m
    });
}

From source file:com.xinlv.test.PortalTestUtil.java

public static void callOnBeginRequest() {
    try {//from w  ww  . ja va 2  s  .  com
        Method method = RequestCycle.class.getDeclaredMethod("onBeginRequest", (Class<?>[]) null);
        method.setAccessible(true);
        method.invoke(RequestCycle.get(), (Object[]) null);
    } catch (Exception e) {
        throw new UnhandledException(e);
    }

}

From source file:ar.com.zauber.common.image.impl.FileImage.java

/** @see Flyer#getInputStream() */
public final InputStream getInputStream() {
    try {/*ww w  .j a v a  2 s  .  c  o m*/
        return new FileInputStream(getFile());
    } catch (final FileNotFoundException e) {
        throw new UnhandledException(e);
    }
}