StringEscapeUtils

public class StringEscapeUtils
extends Object

java.lang.Object
com.android.tradefed.util.StringEscapeUtils


Utility class for escaping strings for specific formats. Include methods to escape strings that are being passed to the Android Shell.

สรุป

เครื่องมือสร้างสาธารณะ

StringEscapeUtils()

เมธอดสาธารณะ

static String escapeShell(String str)

Escapes a String for use in an Android shell command.

static List<String> paramsToArgs(List<String> params)

Converts the provided parameters via options to command line args to sub process

This method will do a simplistic generic unescape for each parameter in the list.

เครื่องมือสร้างสาธารณะ

StringEscapeUtils

public StringEscapeUtils ()

เมธอดสาธารณะ

escapeShell

public static String escapeShell (String str)

Escapes a String for use in an Android shell command.

พารามิเตอร์
str String: the String to escape

การคืนสินค้า
String the Android shell escaped String

paramsToArgs

public static List<String> paramsToArgs (List<String> params)

Converts the provided parameters via options to command line args to sub process

This method will do a simplistic generic unescape for each parameter in the list. It replaces \[char] with [char]. For example, \" is converted to ". This allows string with escaped double quotes to stay as a string after being parsed by QuotationAwareTokenizer. Without this QuotationAwareTokenizer will break the string into sections if it has space in it.

พารามิเตอร์
params List: parameters received via options

การคืนสินค้า
List<String> list of string representing command line args