List of usage examples for org.apache.wicket.util.crypt Base64 isArrayByteBase64
public static boolean isArrayByteBase64(final byte[] arrayOctet)
From source file:org.xaloon.wicket.util.UrlUtils.java
License:Apache License
/** * Decodes provided string from base64/*w w w .j a va 2 s . c o m*/ * * @param value * @param preffix * @return decoded string from base64 */ public static String decodeBase64(String value, String preffix) { if (StringUtils.isEmpty(value)) { return null; } if (StringUtils.isNotEmpty(preffix) && value.contains(preffix)) { value = value.substring(0, value.indexOf(preffix)); } byte[] bytes = value.getBytes(); if (!Base64.isArrayByteBase64(bytes)) { return value; } return new String(Base64.decodeBase64(bytes)); }