AndroidBuildDownloader

public class AndroidBuildDownloader
extends Object implements IFileDownloader

java.lang.Object
   ↳ com.google.android.tradefed.build.AndroidBuildDownloader


Một IFileDownloader truy xuất các tệp từ Android Build API.

Tóm tắt

Trường

protected static final ConcurrentMap<String, RemoteZip> REMOTE_ZIP_CACHE

Bộ nhớ đệm của các tệp zip từ xa được lập chỉ mục theo đường dẫn từ xa.

Hàm khởi tạo công khai

AndroidBuildDownloader()

Phương thức công khai

static File createTempFile(String remoteFilePath, File rootDir)

Tạo một tệp duy nhất trên ổ đĩa tạm thời để lưu trữ tệp đã tải xuống theo đường dẫn đã cho.

void downloadFile(String remoteFilePath, File destFile, long startOffset, long size)

Dạng thay thế của downloadFile(String,File), cho phép người gọi tải một phần của tệp xuống và lưu vào một tệp đích cụ thể.

void downloadFile(String remoteFilePath, File destFile)

Dạng thay thế của downloadFile(String), cho phép người gọi chỉ định tệp đích mà nội dung từ xa sẽ được đặt vào.

File downloadFile(String remoteFilePath)

Tải một tệp từ xa xuống một tệp tạm thời trên ổ đĩa cục bộ.

void downloadZippedFiles(File destDir, String remoteFilePath, List<String> includeFilters, List<String> excludeFilters)

Tải các tệp khớp với bộ lọc đã cho xuống trong một tệp zip từ xa.

void enablePartialDownloadCache(boolean enablePartialDownloadCache)
void setMetadataCheck(boolean enableMetadataCheck)
void setResolveSymlinks(boolean resolveSymlinks)
void setUseMd5(boolean useMd5)

Phương thức được bảo vệ

AndroidBuildFetcher getBuildFetcher()

Trả về một AndroidBuildFetcher, tạo một AndroidBuildFetcher nếu chưa có.

void setBuildEnvironment(String buildEnvironment)

Trường

REMOTE_ZIP_CACHE

protected static final ConcurrentMap<String, RemoteZip> REMOTE_ZIP_CACHE

Bộ nhớ đệm của các tệp zip từ xa được lập chỉ mục theo đường dẫn từ xa.

Hàm khởi tạo công khai

AndroidBuildDownloader

public AndroidBuildDownloader ()

Phương thức công khai

createTempFile

public static File createTempFile (String remoteFilePath, 
                File rootDir)

Tạo một tệp duy nhất trên ổ đĩa tạm thời để lưu trữ tệp đã tải xuống theo đường dẫn đã cho.

Tạo tên tệp dựa trên tên tệp cơ sở từ đường dẫn

Tham số
remoteFilePath String: đường dẫn từ xa để tạo tên

rootDir File

Giá trị trả về
File

Gửi
BuildRetrievalError

downloadFile

public void downloadFile (String remoteFilePath, 
                File destFile, 
                long startOffset, 
                long size)

Dạng thay thế của downloadFile(String,File), cho phép người gọi tải một phần của tệp xuống và lưu vào một tệp đích cụ thể.

Tham số
remoteFilePath String: đường dẫn từ xa đến tệp cần tải xuống, tương ứng với một gốc dành riêng cho quá trình triển khai.

destFile File: tệp để đặt nội dung đã tải xuống vào. Không được tồn tại.

startOffset long: độ lệch bắt đầu trong tệp từ xa.

size long: số byte cần tải xuống từ tệp từ xa. Đặt giá trị này thành một giá trị âm để tải toàn bộ tệp xuống.

Gửi
BuildRetrievalError

downloadFile

public void downloadFile (String remoteFilePath, 
                File destFile)

Dạng thay thế của downloadFile(String), cho phép người gọi chỉ định tệp đích mà nội dung từ xa sẽ được đặt vào.

Tham số
remoteFilePath String: đường dẫn từ xa đến tệp cần tải xuống, tương ứng với một gốc dành riêng cho quá trình triển khai.

destFile File: tệp để đặt nội dung đã tải xuống vào. Không được tồn tại.

Gửi
BuildRetrievalError

downloadFile

public File downloadFile (String remoteFilePath)

Tải một tệp từ xa xuống một tệp tạm thời trên ổ đĩa cục bộ.

Tham số
remoteFilePath String: đường dẫn từ xa đến tệp cần tải xuống, tương ứng với một gốc cụ thể của quá trình triển khai.

Giá trị trả về
File File đã tải xuống tạm thời trên thiết bị.

Gửi
BuildRetrievalError

downloadZippedFiles

public void downloadZippedFiles (File destDir, 
                String remoteFilePath, 
                List<String> includeFilters, 
                List<String> excludeFilters)

Tải các tệp khớp với bộ lọc đã cho xuống trong một tệp zip từ xa.

Tệp bên trong tệp zip từ xa chỉ được tải xuống khi đường dẫn của tệp đó khớp với bất kỳ bộ lọc nào trong số các bộ lọc bao gồm nhưng không khớp với các bộ lọc loại trừ.

Tham số
destDir File: tệp để đặt nội dung đã tải xuống vào.

remoteFilePath String: đường dẫn từ xa đến tệp cần tải xuống, tương ứng với một gốc cụ thể của quá trình triển khai.

includeFilters List: danh sách các bộ lọc để tải các tệp phù hợp xuống.

excludeFilters List: danh sách các bộ lọc để bỏ qua việc tải các tệp phù hợp xuống.

Gửi
BuildRetrievalError
IOException

enablePartialDownloadCache

public void enablePartialDownloadCache (boolean enablePartialDownloadCache)

Tham số
enablePartialDownloadCache boolean

setMetadataCheck

public void setMetadataCheck (boolean enableMetadataCheck)

Tham số
enableMetadataCheck boolean

setResolveSymlinks

public void setResolveSymlinks (boolean resolveSymlinks)

Tham số
resolveSymlinks boolean

setUseMd5

public void setUseMd5 (boolean useMd5)

Tham số
useMd5 boolean

Phương thức được bảo vệ

getBuildFetcher

protected AndroidBuildFetcher getBuildFetcher ()

Trả về một AndroidBuildFetcher, tạo một AndroidBuildFetcher nếu chưa có.

Giá trị trả về
AndroidBuildFetcher

Gửi
GeneralSecurityException
IOException

setBuildEnvironment

protected void setBuildEnvironment (String buildEnvironment)

Tham số
buildEnvironment String