Bugreport

public class Bugreport
extends Object

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


Object holding the bugreport files references, compatible of flat bugreport and zipped bugreport (bugreportz).

Summary

Public constructors

Bugreport(File bugreportFile, boolean isZipped)

Public methods

void close()

Clean up the files held by the bugreport object.

File getFileByName(String name)

Return the ERROR(/File) associated with the name in the bugreport.

getListOfFiles()

Returns the list of files contained inside the zipped bugreport.

File getMainFile()

Return a ERROR(/File) pointing to the bugreport main file.

boolean isZipped()

Return true if it's a zipped bugreport, false otherwise.

void log(String dataName, ITestLogger logger)

Helper to log the Bugreport whether its zipped or not.

Public constructors

Bugreport

public Bugreport (File bugreportFile, 
                boolean isZipped)

Parameters
bugreportFile File

isZipped boolean

Public methods

close

public void close ()

Clean up the files held by the bugreport object. Must be called when the object is not used anymore.

getFileByName

public File getFileByName (String name)

Return the ERROR(/File) associated with the name in the bugreport. Null if not found or if name is null. Non zipped bugreport always return null. The returned file is a copy and should be appropriately managed by the user.

Parameters
name String

Returns
File

getListOfFiles

public  getListOfFiles ()

Returns the list of files contained inside the zipped bugreport. Null if it's not a zipped bugreport.

Returns

getMainFile

public File getMainFile ()

Return a ERROR(/File) pointing to the bugreport main file. For a flat bugreport, it returns the flat bugreport itself. For a zipped bugreport, it returns the main entry file. The returned file is a copy and should be appropriately managed by the user.

Returns
File

isZipped

public boolean isZipped ()

Return true if it's a zipped bugreport, false otherwise.

Returns
boolean

log

public void log (String dataName, 
                ITestLogger logger)

Helper to log the Bugreport whether its zipped or not.

Parameters
dataName String: the name of the data once logged.

logger ITestLogger: a ITestLogger to receive the log.