bugreport

public class Bugreport
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.Bugreport


用于存储 bugreport 文件引用的对象,与平面 bugreport 和压缩 bugreport (bugreportz) 兼容。

摘要

公共构造函数

Bugreport(File bugreportFile, boolean isZipped)

公共方法

void close()

清理 bugreport 对象持有的文件。

File getFileByName(String name)

返回 bugreport 中与名称关联的 ERROR(/File)

getListOfFiles()

返回压缩 bug 报告中包含的文件列表。

File getMainFile()

返回指向 bugreport 主文件的 ERROR(/File)

boolean isZipped()

如果是压缩的 bug 报告,则返回 true,否则返回 false。

void log(String dataName, ITestLogger logger)

用于记录 bug 报告(无论是否已压缩)的帮助程序。

公共构造函数

bugreport

public Bugreport (File bugreportFile, 
                boolean isZipped)

参数
bugreportFile File

isZipped boolean

公共方法

关闭

public void close ()

清理 bugreport 对象持有的文件。当不再使用对象时,必须调用此方法。

getFileByName

public File getFileByName (String name)

返回与 bugreport 中的名称关联的 ERROR(/File)。如果未找到或名称为 null,则为 null。非压缩 bugreport 始终返回 null。 返回的文件是副本,应由用户妥善管理。

参数
name String

返回
File

getListOfFiles

public  getListOfFiles ()

返回压缩 bug 报告中包含的文件列表。如果不是压缩的 bug 报告,则为 null。

返回

getMainFile

public File getMainFile ()

返回指向 bugreport 主文件的 ERROR(/File)。对于扁平 bugreport,它会返回扁平 bugreport 本身。对于压缩的 bug 报告,它会返回主要的入口文件。返回的文件是副本,应由用户妥善管理。

返回
File

isZipped

public boolean isZipped ()

如果是压缩的 bug 报告,则返回 true;否则返回 false。

返回
boolean

log

public void log (String dataName, 
                ITestLogger logger)

用于记录 bug 报告(无论是否已压缩)的帮助程序。

参数
dataName String:记录后的数据的名称。

logger ITestLogger:用于接收日志的 ITestLogger