GCSFileDownloader

public class GCSFileDownloader
extends GCSFileDownloaderBase implements IFileDownloader

java.lang.Object
   ↳ com.android.tradefed.util.gcs.GCSCommon
     ↳ com.android.tradefed.util.gcs.GCSFileDownloaderBase
       ↳ com.android.tradefed.util.GCSFileDownloader


Google Cloud Storage (GCS)에서 파일을 다운로드하는 파일 다운로더입니다.

요약

공개 생성자

GCSFileDownloader()
GCSFileDownloader(Boolean createEmptyFile)
GCSFileDownloader(File jsonKeyFile)

공개 메서드

static File createTempFileForRemote(String remoteFilePath, File rootDir)
void downloadFile(String remotePath, File destFile)
File downloadFile(String remoteFilePath)

GCS에서 파일을 다운로드합니다.

boolean isFresh(File localFile, String remotePath)

로컬 파일의 최신 상태를 확인합니다.

보호된 메서드

void clearCache()
void downloadFile(String bucketName, String remoteFilename, File localFile)
Storage getStorage( scopes)

TF 옵션에 따라 사용자 인증 정보를 지원하도록 기본 구현을 재정의합니다.

String[] parseGcsPath(String remotePath)

공개 생성자

GCSFileDownloader

public GCSFileDownloader ()

GCSFileDownloader

public GCSFileDownloader (Boolean createEmptyFile)

매개변수
createEmptyFile Boolean

GCSFileDownloader

public GCSFileDownloader (File jsonKeyFile)

매개변수
jsonKeyFile File

공개 메서드

createTempFileForRemote

public static File createTempFileForRemote (String remoteFilePath, 
                File rootDir)

매개변수
remoteFilePath String

rootDir File

반환 값
File

생성 값
BuildRetrievalError

downloadFile

public void downloadFile (String remotePath, 
                File destFile)

매개변수
remotePath String

destFile File

생성 값
BuildRetrievalError

downloadFile

public File downloadFile (String remoteFilePath)

GCS에서 파일을 다운로드합니다.

현재 GCS 경로만 지원됩니다.

매개변수
remoteFilePath String: gs://bucket/file/path 형식의 GCS 경로입니다.

반환 값
File 로컬 파일

생성 값
com.android.tradefed.build.BuildRetrievalError
BuildRetrievalError

isFresh

public boolean isFresh (File localFile, 
                String remotePath)

로컬 파일의 최신 상태를 확인합니다. 로컬 파일이 원격 파일과 동일하면 최신 파일입니다. 그렇지 않으면 로컬 파일이 비활성 상태입니다. 주로 캐시에 사용됩니다. 기본 구현은 항상 true를 반환하므로 파일이 변경 불가능한 경우 최신성을 확인할 필요가 없습니다.

매개변수
localFile File: 로컬 파일입니다.

remotePath String: 원격 파일 경로입니다.

반환 값
boolean 로컬 파일이 최신 상태인 경우 true, 그렇지 않은 경우 false입니다.

생성 값
BuildRetrievalError

보호된 메서드

clearCache

protected void clearCache ()

downloadFile

protected void downloadFile (String bucketName, 
                String remoteFilename, 
                File localFile)

매개변수
bucketName String

remoteFilename String

localFile File

생성 값
BuildRetrievalError

getStorage

protected Storage getStorage ( scopes)

TF 옵션에 따라 사용자 인증 정보를 지원하도록 기본 구현을 재정의합니다.

매개변수
scopes : 사용자 인증 정보를 요청할 특정 범위입니다.

반환 값
Storage GCS 버킷의 Storage 객체

생성 값
IOException

parseGcsPath

protected String[] parseGcsPath (String remotePath)

매개변수
remotePath String

반환 값
String[]

생성 값
BuildRetrievalError