Google is committed to advancing racial equity for Black communities. See how.

LocalHostResourceManager

public class LocalHostResourceManager
extends Object implements IHostResourceManager

java.lang.Object
   ↳ com.android.tradefed.host.LocalHostResourceManager


Manager host resource. The host resources are local files.

Summary

Public constructors

LocalHostResourceManager()

Public methods

void cleanup()

Clean up host resources.

File getFile(String name)

Get host resource local file by the resource id.

void setup()

Set up host resources.

Protected methods

void clearHostResource(String name, File localFile)

Clear a local host resource.

File fetchHostResource(String name, String value)

Use a local file a host resource.

Public constructors

LocalHostResourceManager

public LocalHostResourceManager ()

Public methods

cleanup

public void cleanup ()

Clean up host resources.

getFile

public File getFile (String name)

Get host resource local file by the resource id.

Parameters
name String: the resource id of the host resource.

Returns
File The local file of the host resource.

setup

public void setup ()

Set up host resources. Host resources might come from different places, remote on cloud or local files. This interface provides a unified way for tradefed to get the host resource it needs. setup should properly download files to local and later tradefed can get the local by the host resource name through getFile.

Throws
ConfigurationException

Protected methods

clearHostResource

protected void clearHostResource (String name, 
                File localFile)

Clear a local host resource.

Parameters
name String: the id of the host resource.

localFile File: the local file.

fetchHostResource

protected File fetchHostResource (String name, 
                String value)

Use a local file a host resource.

Parameters
name String: the name of the host resource.

value String: the local path of the host resource.

Returns
File the local file.

Throws
ConfigurationException