ResourceUtil

public class ResourceUtil
extends Object

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


ยูทิลิตี้สำหรับการอ่านทรัพยากรการกำหนดค่า

สรุป

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

ResourceUtil()

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

static boolean extractResourceAsFile(String resource, File output)

DEPRECATED: Use extractResourceToFile Extracts a given resource to an output file.

static void extractResourceToFile(String resource, File output)

Extracts a given resource to an output file.

static boolean extractResourceWithAltAsFile(String resource, String altResourcePath, File output)

Extracts a given resource to an output file with fallback alternative path.

static Map<String, String> readConfigurationFromFile(File propertyFile)

Read a property configuration from a file.

static Map<String, String> readConfigurationFromResource(String resource)

Read a property configuration from the resources.

static Map<String, String> readConfigurationFromStream(InputStream propertyStream)

Read a property configuration from a stream.

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

ResourceUtil

public ResourceUtil ()

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

extractResourceAsFile

public static boolean extractResourceAsFile (String resource, 
                File output)

DEPRECATED: Use extractResourceToFile Extracts a given resource to an output file.

พารามิเตอร์
resource String

output File

การคืนสินค้า
boolean

extractResourceToFile

public static void extractResourceToFile (String resource, 
                File output)

Extracts a given resource to an output file.

พารามิเตอร์
resource String

output File

ส่ง
IOException

extractResourceWithAltAsFile

public static boolean extractResourceWithAltAsFile (String resource, 
                String altResourcePath, 
                File output)

Extracts a given resource to an output file with fallback alternative path. Returns false if it fails.

พารามิเตอร์
resource String

altResourcePath String

output File

การคืนสินค้า
boolean

readConfigurationFromFile

public static Map<String, String> readConfigurationFromFile (File propertyFile)

Read a property configuration from a file. Configuration must follow a "key=value" or "key:value" format. Method is safe and will return an empty map in case of error.

พารามิเตอร์
propertyFile File: The path of the resource to read.

การคืนสินค้า
Map<String, String> Map of the loaded resources.

ดูเพิ่มเติม

readConfigurationFromResource

public static Map<String, String> readConfigurationFromResource (String resource)

Read a property configuration from the resources. Configuration must follow a "key=value" or "key:value" format. Method is safe and will return an empty map in case of error.

พารามิเตอร์
resource String: The path of the resource to read.

การคืนสินค้า
Map<String, String> Map of the loaded resources.

ดูเพิ่มเติม

readConfigurationFromStream

public static Map<String, String> readConfigurationFromStream (InputStream propertyStream)

Read a property configuration from a stream. Configuration must follow a "key=value" or "key:value" format. Method is safe and will return an empty map in case of error.

พารามิเตอร์
propertyStream InputStream: The path of the resource to read.

การคืนสินค้า
Map<String, String> Map of the loaded resources.

ดูเพิ่มเติม