Java XML Data Type Converter encodeJavaOpts(String javaOpts)

Here you can find the source of encodeJavaOpts(String javaOpts)

Description

Encode the JVM options
1.

License

Open Source License

Return

encoded string

Declaration

public static String encodeJavaOpts(String javaOpts) 

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 {
    /**/* w  ww .  java2 s . c o m*/
     * Encode the JVM options
     * <br> 1. Convert it into Base64 format
     * <br> 2. Add \" at the start and at the end
     * <br> 3. replace "=" with "&amp;equals;"
     *
     * @return encoded string
     */
    public static String encodeJavaOpts(String javaOpts) {
        String javaOptsBase64 = DatatypeConverter.printBase64Binary(javaOpts.getBytes(Charset.forName("UTF-8")));

        return String.format("\"%s\"", javaOptsBase64.replace("=", "&equals;"));
    }
}

Related

  1. deCrypt(String property)
  2. deserializeFromString(String x)
  3. deserializeLogic(String logicString)
  4. encodeBasicHeader(final String username, final String password)
  5. encodeDoubleArray(double[] noData)
  6. encrypt(String plainText, String password)
  7. encryptPassword(String unencrypted)
  8. fetchUrl(String url, String username, String password)
  9. formatFriendlyName(final byte[] addressBytes)