Java XML Data Type Converter decodeJavaOpts(String encodedJavaOpts)

Here you can find the source of decodeJavaOpts(String encodedJavaOpts)

Description

Decode the JVM options
1.

License

Open Source License

Return

decoded string

Declaration

public static String decodeJavaOpts(String encodedJavaOpts) 

Method Source Code


//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

import java.nio.charset.Charset;

import javax.xml.bind.DatatypeConverter;

public class Main {
    /**//from w  w  w  .j a va2 s .com
     * Decode the JVM options
     * <br> 1. strip \" at the start and at the end
     * <br> 2. replace "&amp;equals;" with "="
     * <br> 3. Revert from Base64 format
     *
     * @return decoded string
     */
    public static String decodeJavaOpts(String encodedJavaOpts) {
        String javaOptsBase64 = encodedJavaOpts.replaceAll("^\"+", "").replaceAll("\\s+$", "").replace("&equals;",
                "=");

        return new String(DatatypeConverter.parseBase64Binary(javaOptsBase64), Charset.forName("UTF-8"));
    }
}

Related

  1. decode(final CharSequence _text)
  2. decode(String auth)
  3. decode(String source)
  4. decode(String string, boolean decode)
  5. decodeBasicAuth(String auth)
  6. decodeToDoubleArray(String encoded)
  7. decrypt(String encryptedText, String password)
  8. deCrypt(String property)
  9. deserializeFromString(String x)