Example usage for org.apache.commons.codec DecoderException getLocalizedMessage

List of usage examples for org.apache.commons.codec DecoderException getLocalizedMessage

Introduction

In this page you can find the example usage for org.apache.commons.codec DecoderException getLocalizedMessage.

Prototype

public String getLocalizedMessage() 

Source Link

Document

Creates a localized description of this throwable.

Usage

From source file:nor.util.Codec.java

public static String urlDecode(final String str) {

    String ret = str;// w ww .jav a2s . c  o  m
    try {

        ret = URLCodec.decode(str);

    } catch (DecoderException e) {

        LOGGER.severe(e.getLocalizedMessage());

    }

    return ret;

}

From source file:nor.util.Codec.java

public static String base64Decode(final String str) {

    String ret = str;//from   w w  w  .  j  av a  2  s.  c  om
    try {

        ret = BCodec.decode(str);

    } catch (DecoderException e) {

        LOGGER.severe(e.getLocalizedMessage());

    }

    return ret;

}

From source file:org.apache.openaz.xacml.admin.view.validators.HexBinaryValidator.java

@Override
public void validate(Object value) throws InvalidValueException {
    if (value instanceof String) {
        try {//  w  w  w. jav a 2  s .c o  m
            HexBinary.newInstance((String) value);
        } catch (DecoderException e) {
            throw new InvalidValueException(e.getLocalizedMessage());
        }
    } else
        throw new InvalidValueException("Unrecognized HexBinary");
}