Example usage for org.apache.commons.lang.exception NestableRuntimeException NestableRuntimeException

List of usage examples for org.apache.commons.lang.exception NestableRuntimeException NestableRuntimeException

Introduction

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

Prototype

public NestableRuntimeException(Throwable cause) 

Source Link

Document

Constructs a new NestableRuntimeException with specified nested Throwable.

Usage

From source file:com.alibaba.otter.shared.common.utils.ByteUtils.java

public static String bytesToString(byte[] bytes) {
    try {//from www .  j  av  a  2  s  . co m
        return new String(bytes, "UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new NestableRuntimeException(e);
    }
}

From source file:com.alibaba.otter.shared.common.utils.ByteUtils.java

public static byte[] stringToBytes(String string) {
    try {/*from  www  .j  av  a2  s.c  o m*/
        return string.getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new NestableRuntimeException(e);
    }
}

From source file:com.alibaba.otter.shared.common.utils.ByteUtils.java

public static String bytesToBase64String(byte[] bytes) {
    try {//from ww  w .j ava 2  s  .c o m
        return new String(Base64.encodeBase64(bytes), "UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new NestableRuntimeException(e);
    }
}

From source file:com.alibaba.otter.shared.common.utils.ByteUtils.java

public static byte[] base64StringToBytes(String string) {
    try {//from  w  w w .ja v  a 2 s.co  m
        return Base64.decodeBase64(string.getBytes("UTF-8"));
    } catch (UnsupportedEncodingException e) {
        throw new NestableRuntimeException(e);
    }
}

From source file:info.magnolia.cms.taglibs.util.Xmp.java

/**
 * @see javax.servlet.jsp.tagext.Tag#doEndTag()
 *///from  w  w  w  .  j a v a2s  .  c  om
public int doEndTag() {
    JspWriter out = pageContext.getOut();
    String xmpString = getBodyContent().getString();
    try {
        out.print(StringEscapeUtils.escapeHtml(xmpString));
    } catch (IOException e) {
        // should never happen
        throw new NestableRuntimeException(e);
    }
    return EVAL_PAGE;
}

From source file:info.magnolia.cms.core.ContentHandler.java

/**
 * Bit by bit copy of the current object.
 * @return Object cloned object// w  w w .j  av a  2 s .com
 */
protected Object clone() {
    try {
        return super.clone();
    } catch (CloneNotSupportedException e) {
        // should never happen
        throw new NestableRuntimeException(e);
    }
}

From source file:com.xwtec.xwserver.util.json.regexp.Perl5RegexpMatcher.java

public Perl5RegexpMatcher(String pattern, boolean multiline) {
    try {//  w  ww. ja  v  a 2s.  co  m
        if (multiline) {
            this.pattern = compiler.compile(pattern,
                    Perl5Compiler.READ_ONLY_MASK | Perl5Compiler.MULTILINE_MASK);
        } else {
            this.pattern = compiler.compile(pattern, Perl5Compiler.READ_ONLY_MASK);
        }
    } catch (MalformedPatternException mpe) {
        throw new NestableRuntimeException(mpe);
    }
}

From source file:com.google.code.or.io.util.XSerializer.java

/**
 * /*from w  w  w. ja v  a 2 s.  c  om*/
 */
public void flush() {
    try {
        this.tos.flush();
    } catch (IOException e) {
        throw new NestableRuntimeException(e);
    }
}

From source file:com.zju.ccnt.or.common.util.XSerializer.java

/**
 * //from w w  w. j a  va  2 s .  c  om
 */
@Override
public void flush() {
    try {
        this.tos.flush();
    } catch (IOException e) {
        throw new NestableRuntimeException(e);
    }
}

From source file:com.google.code.or.io.util.XSerializer.java

public void close() throws IOException {
    try {/*  www .  j  av  a2s. c  o  m*/
        this.tos.close();
    } catch (IOException e) {
        throw new NestableRuntimeException(e);
    }
}