Bugreport

public class Bugreport
extends Object implements Closeable

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 File associated with the name in the bugreport.

List<String> getListOfFiles()

Returns the list of files contained inside the zipped bugreport.

File getMainFile()

Return a 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

Bugreport (File bugreportFile, 
                boolean isZipped)

Parameters
bugreportFile File
isZipped boolean

Public methods

close

void close ()

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

Throws
IOException

getFileByName

File getFileByName (String name)

Return the 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

List<String> getListOfFiles ()

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

Returns
List<String>

getMainFile

File getMainFile ()

Return a 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

boolean isZipped ()

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

Returns
boolean

log

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.