為配合主幹穩定開發模型,並確保生態系統的平台穩定性,我們將自 2026 年起,在第 2 季和第 4 季將原始碼發布至 AOSP。如要建構及貢獻 AOSP,請使用 android-latest-release。android-latest-release 資訊清單分支版本一律會參照推送至 Android 開放原始碼計畫的最新版本。詳情請參閱「Android 開放原始碼計畫變更」。
Google 會運用 AI 技術將內容翻譯成你偏好的語言,但可能會出錯。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
CasFileDownloader
public
class
CasFileDownloader
extends Object
implements
IFileDownloader
| java.lang.Object
|
| ↳ |
com.google.android.tradefed.util.CasFileDownloader
|
檔案下載器,可從 RBE CAS 下載檔案。
摘要
公用建構函式 |
CasFileDownloader(IFileDownloader fallbackDownloader, File manifestPath, boolean casAutoDiscovery, boolean casChunk, boolean casChunkDir)
CasFileDownloader 的建構函式。
|
CasFileDownloader(IFileDownloader fallbackDownloader, File cacheDir, File manifestPath, boolean casAutoDiscovery, boolean casChunk, boolean casChunkDir, File casServiceAccountJson, File tempFileRoot, IRunUtil runUtil)
|
公用方法 |
void
|
downloadFile(String remoteFilePath, File destFile, long startOffset, long size)
downloadFile(String,File) 的替代形式,可讓呼叫端下載檔案的某個部分,並儲存至特定目的地檔案。
|
void
|
downloadFile(String relativeRemotePath, File destFile)
downloadFile(String) 的替代形式,可讓呼叫端指定遠端內容應放置的目標檔案。
|
File
|
downloadFile(String remoteFilePath)
將遠端檔案下載至本機磁碟的暫存檔案。
|
void
|
downloadZippedFiles(File destDir, String remoteFilePath, List<String> includeFilters, List<String> excludeFilters)
以遠端 ZIP 檔案的形式,下載符合指定篩選條件的檔案。
|
static
CasOptions
|
getCasOptions()
|
void
|
setCasChunksOptions(boolean casKeepChunks, boolean casChunksOnly)
|
void
|
setCasConcurrency(long casConcurrency)
|
void
|
setCasMemoryLimit(long casMemoryLimit)
|
void
|
setCasRpcTimeout(long casRpcTimeout, long casGetCapabilitiesTimeout, long casBatchUpdateBlobsTimeout, long casBatchReadBlobsTimeout, long casGetTreeTimeout)
|
公用建構函式
CasFileDownloader
public CasFileDownloader (IFileDownloader fallbackDownloader,
File manifestPath,
boolean casAutoDiscovery,
boolean casChunk,
boolean casChunkDir)
CasFileDownloader 的建構函式。
| 參數 |
fallbackDownloader |
IFileDownloader:如果 CAS 檔案下載器無法初始化,或無法從 CAS 下載檔案,則使用此檔案下載器。 |
manifestPath |
File |
casAutoDiscovery |
boolean |
casChunk |
boolean:是否要下載分塊版本 (如果兩個版本都可下載)。 |
casChunkDir |
boolean:是否要將未壓縮的區塊版本下載為目錄。 |
CasFileDownloader
public CasFileDownloader (IFileDownloader fallbackDownloader,
File cacheDir,
File manifestPath,
boolean casAutoDiscovery,
boolean casChunk,
boolean casChunkDir,
File casServiceAccountJson,
File tempFileRoot,
IRunUtil runUtil)
| 參數 |
fallbackDownloader |
IFileDownloader |
cacheDir |
File |
manifestPath |
File |
casAutoDiscovery |
boolean |
casChunk |
boolean |
casChunkDir |
boolean |
casServiceAccountJson |
File |
tempFileRoot |
File |
runUtil |
IRunUtil |
公用方法
downloadFile
public void downloadFile (String remoteFilePath,
File destFile,
long startOffset,
long size)
downloadFile(String,File) 的替代形式,可讓呼叫端下載檔案的某個部分,並儲存至特定目的地檔案。
| 參數 |
remoteFilePath |
String:要下載的檔案遠端路徑,相對於實作專屬的根目錄。 |
destFile |
File:要將下載內容放入的檔案。不應存在。 |
startOffset |
long:遠端檔案中的起始偏移。 |
size |
long:要從遠端檔案下載的位元組數。設為負值即可下載整個檔案。 |
downloadFile
public void downloadFile (String relativeRemotePath,
File destFile)
downloadFile(String) 的替代形式,可讓呼叫端指定應放置遠端內容的目標檔案。
| 參數 |
relativeRemotePath |
String:要下載的檔案遠端路徑,相對於實作專屬的根目錄。 |
destFile |
File:要將下載內容放入的檔案。不應存在。 |
downloadFile
public File downloadFile (String remoteFilePath)
將遠端檔案下載至本機磁碟的暫存檔案。
| 參數 |
remoteFilePath |
String:要下載的檔案的遠端路徑,相對於實作專屬根目錄。 |
downloadZippedFiles
public void downloadZippedFiles (File destDir,
String remoteFilePath,
List<String> includeFilters,
List<String> excludeFilters)
以遠端 ZIP 檔案的形式,下載符合指定篩選條件的檔案。
只有在遠端 ZIP 檔案中的檔案路徑符合任何包含篩選器,但不符合排除篩選器時,才會下載該檔案。
| 參數 |
destDir |
File:要將下載內容放入的檔案。 |
remoteFilePath |
String:要下載的檔案的遠端路徑,相對於實作專屬根目錄。 |
includeFilters |
List:要下載相符檔案的篩選器清單。 |
excludeFilters |
List:要略過下載相符檔案的篩選器清單。 |
getCasOptions
public static CasOptions getCasOptions ()
setCasChunksOptions
public void setCasChunksOptions (boolean casKeepChunks,
boolean casChunksOnly)
| 參數 |
casKeepChunks |
boolean |
casChunksOnly |
boolean |
setCasConcurrency
public void setCasConcurrency (long casConcurrency)
setCasMemoryLimit
public void setCasMemoryLimit (long casMemoryLimit)
setCasRpcTimeout
public void setCasRpcTimeout (long casRpcTimeout,
long casGetCapabilitiesTimeout,
long casBatchUpdateBlobsTimeout,
long casBatchReadBlobsTimeout,
long casGetTreeTimeout)
| 參數 |
casRpcTimeout |
long |
casGetCapabilitiesTimeout |
long |
casBatchUpdateBlobsTimeout |
long |
casBatchReadBlobsTimeout |
long |
casGetTreeTimeout |
long |
受保護的方法
protected File extractCasClient (String clientName)
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2026-06-22 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2026-06-22 (世界標準時間)。"],[],[]]