private void loadComponentVars(String input) { if (input == null || input.equals("")) { return; } String[] keyValues = input.split(","); for (String kvs : keyValues) { String[] split = kvs.split(":"); String keyEncoded = split[0]; String valueEncoded = split[1]; String key = StringUtils.toAsciiString(Base64Coder.decode(keyEncoded)); String value = StringUtils.toAsciiString(Base64Coder.decode(valueEncoded)); this.componentVars.put(key, value); } }
private void loadSavedMessages(String input) { String[] messages = input.split(","); for (String encodedMessage : messages) { String message = StringUtils.toAsciiString(Base64Coder.decode(encodedMessage)); this.savedMessages.add(message); } }
static { byte[] testBytes = Base64Coder.decode( "ICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVpbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX4NCg=="); Charset defaultCharset = Charset.defaultCharset(); String resultString = new String(testBytes, defaultCharset); boolean trueUTF = defaultCharset.name().contains("UTF"); UTF8_OVERRIDE = (!" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\r\n" .equals(resultString)) || (defaultCharset.equals(Charset.forName("US-ASCII"))); SYSTEM_UTF = (trueUTF) || (UTF8_OVERRIDE); UTF_BIG = (trueUTF) && (UTF8_OVERRIDE); }