Example usage for com.google.common.base CharMatcher breakingWhitespace

List of usage examples for com.google.common.base CharMatcher breakingWhitespace

Introduction

In this page you can find the example usage for com.google.common.base CharMatcher breakingWhitespace.

Prototype

public static CharMatcher breakingWhitespace() 

Source Link

Document

Determines whether a character is a breaking whitespace (that is, a whitespace which can be interpreted as a break between words for formatting purposes).

Usage

From source file:org.jboss.hal.dmr.ModelNode.java

/**
 * Creates a new node from a base64 encoded string
 *
 * @param encoded The base64 encoded string.
 *
 * @return the new model node/*from   ww  w .  ja  va2 s  . c om*/
 */
public static ModelNode fromBase64(String encoded) {
    // Bloody IE can't cope with line breaks when decoding base64!
    String safeEncoded = CharMatcher.breakingWhitespace().removeFrom(encoded);
    ModelNode node = new ModelNode();
    String decoded = Base64.decode(safeEncoded);
    node.readExternal(new DataInput(toBytes(decoded)));
    return node;
}