Effective in 2026, to align with our trunk stable development model and ensure platform stability for the ecosystem, we will publish source code to AOSP in Q2 and Q4. For building and contributing to AOSP, use android-latest-release. The android-latest-release manifest branch will always reference the most recent release pushed to AOSP. For more information, see Changes to AOSP.
Stay organized with collections
Save and categorize content based on your preferences.
AndroidBuildDownloader
public
class
AndroidBuildDownloader
extends Object
implements
IFileDownloader
| java.lang.Object
|
| ↳ |
com.google.android.tradefed.build.AndroidBuildDownloader
|
A IFileDownloader that retrieves files from the Android Build API.
Summary
Fields |
protected
static
final
ConcurrentMap<String, RemoteZip> |
REMOTE_ZIP_CACHE
A cache of remote zip files indexed by remote path.
|
Public methods |
static
File
|
createTempFile(String remoteFilePath, File rootDir)
Creates a unique file on temporary disk to house downloaded file with given path.
|
void
|
downloadFile(String remoteFilePath, File destFile, long startOffset, long size)
Alternate form of downloadFile(String,File), that allows caller to download a
section of the file and save to a specific destination file.
|
void
|
downloadFile(String remoteFilePath, File destFile)
Alternate form of downloadFile(String), that allows caller to specify the
destination file the remote contents should be placed in.
|
File
|
downloadFile(String remoteFilePath)
Downloads a remote file to a temporary file on local disk.
|
void
|
downloadZippedFiles(File destDir, String remoteFilePath, List<String> includeFilters, List<String> excludeFilters)
Download the files matching given filters in a remote zip file.
|
void
|
enablePartialDownloadCache(boolean enablePartialDownloadCache)
|
void
|
setMetadataCheck(boolean enableMetadataCheck)
|
void
|
setResolveSymlinks(boolean resolveSymlinks)
|
void
|
setUseMd5(boolean useMd5)
|
Fields
REMOTE_ZIP_CACHE
protected static final ConcurrentMap<String, RemoteZip> REMOTE_ZIP_CACHE
A cache of remote zip files indexed by remote path.
Public constructors
AndroidBuildDownloader
public AndroidBuildDownloader ()
Public methods
createTempFile
public static File createTempFile (String remoteFilePath,
File rootDir)
Creates a unique file on temporary disk to house downloaded file with given path.
Constructs the file name based on base file name from path
| Parameters |
remoteFilePath |
String: the remote path to construct the name from |
rootDir |
File |
downloadFile
public void downloadFile (String remoteFilePath,
File destFile,
long startOffset,
long size)
Alternate form of downloadFile(String,File), that allows caller to download a
section of the file and save to a specific destination file.
| Parameters |
remoteFilePath |
String: the remote path to the file to download, relative to an
implementation-specific root. |
destFile |
File: the file to place the downloaded contents into. Should not exist. |
startOffset |
long: the start offset in the remote file. |
size |
long: the number of bytes to download from the remote file. Set it to a negative value
to download the whole file. |
downloadFile
public void downloadFile (String remoteFilePath,
File destFile)
Alternate form of downloadFile(String), that allows caller to specify the
destination file the remote contents should be placed in.
| Parameters |
remoteFilePath |
String: the remote path to the file to download, relative to an
implementation-specific root. |
destFile |
File: the file to place the downloaded contents into. Should not exist. |
downloadFile
public File downloadFile (String remoteFilePath)
Downloads a remote file to a temporary file on local disk.
| Parameters |
remoteFilePath |
String: the remote path to the file to download, relative to a implementation
specific root. |
| Returns |
File |
the temporary local downloaded File. |
downloadZippedFiles
public void downloadZippedFiles (File destDir,
String remoteFilePath,
List<String> includeFilters,
List<String> excludeFilters)
Download the files matching given filters in a remote zip file.
A file inside the remote zip file is only downloaded to its path matches any of the
include filters but not the exclude filters.
| Parameters |
destDir |
File: the file to place the downloaded contents into. |
remoteFilePath |
String: the remote path to the file to download, relative to an implementation
specific root. |
includeFilters |
List: a list of filters to download matching files. |
excludeFilters |
List: a list of filters to skip downloading matching files. |
enablePartialDownloadCache
public void enablePartialDownloadCache (boolean enablePartialDownloadCache)
| Parameters |
enablePartialDownloadCache |
boolean |
public void setMetadataCheck (boolean enableMetadataCheck)
| Parameters |
enableMetadataCheck |
boolean |
setResolveSymlinks
public void setResolveSymlinks (boolean resolveSymlinks)
| Parameters |
resolveSymlinks |
boolean |
setUseMd5
public void setUseMd5 (boolean useMd5)
| Parameters |
useMd5 |
boolean |
Protected methods
getBuildFetcher
protected AndroidBuildFetcher getBuildFetcher ()
Returns an AndroidBuildFetcher, creating one if it does not already exist.
| Throws |
GeneralSecurityException |
|
IOException |
|
setBuildEnvironment
protected void setBuildEnvironment (String buildEnvironment)
| Parameters |
buildEnvironment |
String |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-06-22 UTC.
[null,null,["Last updated 2026-06-22 UTC."],[],[]]