LogFile

public class LogFile
extends Object implements Serializable

java.lang.Object
↳ com.android.tradefed.result.LogFile


用于保存已保存日志文件的元数据的类。

摘要

公共构造函数

LogFile(String path, String url, boolean isCompressed, LogDataType type, long size)

使用文件路径、网址和 LogDataType 元数据构造 LogFile。

LogFile(String path, String url, LogDataType type)

使用文件路径、网址和 LogDataType 元数据构造 LogFile。

公共方法

String getPath()

获取绝对路径。

long getSize()

获取已记录文件的大小。

LogDataType getType()

获取已记录文件的 LogDataType。

String getUrl()

获取可访问已保存文件的网址。

boolean isCompressed()

获取文件是否已压缩。

boolean isText()

获取文件是否可以显示为文本。

公共构造函数

LogFile

public LogFile (String path, 
                String url, 
                boolean isCompressed, 
                LogDataType type, 
                long size)

使用文件路径、网址和 LogDataType 元数据构造 LogFile。Variation of LogFile.LogFile(String,String,LogDataType) 的变体,其中可以显式设置压缩状态 ,因为在某些情况下,我们会手动压缩文件,但我们希望保留原始类型 以进行跟踪。

参数
path String:已保存文件的绝对路径。

url String:可访问已保存文件的网址。

isCompressed boolean:文件是否已压缩。

type LogDataType:已记录文件的 LogDataType。

size long:已记录文件的大小(以字节为单位)。

LogFile

public LogFile (String path, 
                String url, 
                LogDataType type)

使用文件路径、网址和 LogDataType 元数据构造 LogFile。

参数
path String:已保存文件的绝对路径。

url String:可访问已保存文件的网址。

type LogDataType:已记录文件的 LogDataType。

公共方法

getPath

public String getPath ()

获取绝对路径。

返回
String

getSize

public long getSize ()

获取已记录文件的大小。

返回
long

getType

public LogDataType getType ()

获取已记录文件的 LogDataType。

返回
LogDataType

getUrl

public String getUrl ()

获取可访问已保存文件的网址。

返回
String

isCompressed

public boolean isCompressed ()

获取文件是否已压缩。

返回
boolean

isText

public boolean isText ()

获取文件是否可以显示为文本。

返回
boolean