記錄檔
public class LogFile
extends Object
java.lang.Object | |
↳ | com.android.tradefed.result.LogFile |
用於保存已儲存日誌檔案的元資料的類別。
概括
公共構造函數 | |
---|---|
LogFile (String path, String url, LogDataType type) 使用檔案路徑、URL 和 | |
LogFile (String path, String url, boolean isCompressed, LogDataType type, long size) 使用檔案路徑、URL 和 |
公共方法 | |
---|---|
String | getPath () 取得絕對路徑。 |
long | getSize () 取得記錄檔案的大小。 |
LogDataType | getType () 取得已記錄檔案的 |
String | getUrl () 取得可以存取已儲存檔案的 URL。 |
boolean | isCompressed () 獲取檔案是否被壓縮。 |
boolean | isText () 取得文件是否可以顯示為文字。 |
公共構造函數
記錄檔
public LogFile (String path, String url, LogDataType type)
使用檔案路徑、URL 和LogDataType
元資料建構LogFile
。
參數 | |
---|---|
path | String :儲存檔案的絕對路徑。 |
url | String :可以存取已儲存檔案的 URL。 |
type | LogDataType :記錄檔案的LogDataType 。 |
記錄檔
public LogFile (String path, String url, boolean isCompressed, LogDataType type, long size)
使用檔案路徑、URL 和LogDataType
元資料建構LogFile
。 LogFile#LogFile(String, String, LogDataType)
的變體,其中可以明確設定壓縮狀態,因為在某些情況下,我們手動壓縮文件,但我們希望保留原始類型以用於追蹤目的。
參數 | |
---|---|
path | String :儲存檔案的絕對路徑。 |
url | String :可以存取已儲存檔案的 URL。 |
isCompressed | boolean :檔案是否被壓縮。 |
type | LogDataType :記錄檔案的LogDataType 。 |
size | long :記錄檔案的大小(以位元組為單位)。 |
公共方法
獲取路徑
public String getPath ()
取得絕對路徑。
退貨 | |
---|---|
String |
取得大小
public long getSize ()
取得記錄檔案的大小。
退貨 | |
---|---|
long |
取得網址
public String getUrl ()
取得可以存取已儲存檔案的 URL。
退貨 | |
---|---|
String |
被壓縮
public boolean isCompressed ()
獲取檔案是否被壓縮。
退貨 | |
---|---|
boolean |
是文字
public boolean isText ()
取得文件是否可以顯示為文字。
退貨 | |
---|---|
boolean |