錯誤報告

public class Bugreport
extends Object implements Closeable

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


物件會保留錯誤報告檔案參照,並與一般錯誤報告和壓縮錯誤報告 (bugreportz) 相容。

摘要

公用建構函式

Bugreport(File bugreportFile, boolean isZipped)

公用方法

void close()

清理錯誤報告物件持有的檔案。

File getFileByName(String name)

傳回與錯誤報告中名稱相關聯的 File

List<String> getListOfFiles()

傳回壓縮錯誤報告內含的檔案清單。

File getMainFile()

傳回指向錯誤報告主要檔案的 File

boolean isZipped()

如果這是壓縮的錯誤報告,則傳回 true,否則傳回 false。

void log(String dataName, ITestLogger logger)

Helper to log the Bugreport whether its zipped or not.

公用建構函式

錯誤報告

public Bugreport (File bugreportFile, 
                boolean isZipped)

參數
bugreportFile File

isZipped boolean

公用方法

關閉

public void close ()

清理錯誤報告物件保留的檔案。不再使用物件時,必須呼叫這個方法。

擲回
IOException

getFileByName

public File getFileByName (String name)

傳回與錯誤報告中名稱相關聯的 File。如果找不到或名稱為空值,則為空值。未壓縮的錯誤報告一律會傳回空值。 傳回的檔案是副本,應由使用者妥善管理。

參數
name String

傳回
File

getListOfFiles

public List<String> getListOfFiles ()

傳回壓縮錯誤報告內含的檔案清單。如果不是壓縮的錯誤報告,則為空值。

傳回
List<String>

getMainFile

public File getMainFile ()

傳回指向錯誤報告主要檔案的 File。如果是扁平錯誤報告,則會傳回扁平錯誤報告本身。如果是壓縮的錯誤報告,則會傳回主要項目檔案。傳回的檔案是副本,應由使用者妥善管理。

傳回
File

isZipped

public boolean isZipped ()

如果是壓縮的錯誤報告,則傳回 true,否則傳回 false。

傳回
boolean

log

public void log (String dataName, 
                ITestLogger logger)

Helper 可記錄 Bugreport (無論是否經過壓縮)。

參數
dataName String:記錄資料後的名稱。

logger ITestLogger:接收記錄的 ITestLogger