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


Dosyayı Google Cloud Storage'dan (GCS) indirmek için dosya indirici.

Özet

Herkese açık oluşturucular

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

Herkese açık yöntemler

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

GCS'den dosya indirin.

boolean isFresh(File localFile, String remotePath)

Yerel dosyanın güncelliğini kontrol edin.

Korunan yöntemler

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

TF seçeneklerine dayalı kimlik bilgilerini desteklemek için temeldeki uygulamayı geçersiz kılın.

String[] parseGcsPath(String remotePath)

Herkese açık oluşturucular

GCSFileDownloader

public GCSFileDownloader ()

GCSFileDownloader

public GCSFileDownloader (File jsonKeyFile)

Parametreler
jsonKeyFile File

GCSFileDownloader

public GCSFileDownloader (File jsonKeyFile, 
                Boolean createEmptyFile)

Parametreler
jsonKeyFile File

createEmptyFile Boolean

GCSFileDownloader

public GCSFileDownloader (Boolean createEmptyFile)

Parametreler
createEmptyFile Boolean

Herkese açık yöntemler

createTempFileForRemote

public static File createTempFileForRemote (String remoteFilePath, 
                File rootDir)

Parametreler
remoteFilePath String

rootDir File

Döndürülenler
File

Verdiği hatalar
BuildRetrievalError

downloadFile

public void downloadFile (String remotePath, 
                File destFile)

Parametreler
remotePath String

destFile File

Verdiği hatalar
BuildRetrievalError

downloadFile

public File downloadFile (String remoteFilePath)

GCS'den dosya indirin.

Şu anda yalnızca GCS yolu desteklenmektedir.

Parametreler
remoteFilePath String: gs://bucket/file/path biçiminde GCS yolu.

İadeler
File yerel dosya

Verdiği hatalar
com.android.tradefed.build.BuildRetrievalError
BuildRetrievalError

isFresh

public boolean isFresh (File localFile, 
                String remotePath)

Yerel dosyanın güncelliğini kontrol edin. Yerel dosya, uzak dosyayla aynıysa dosya günceldir. Aksi takdirde yerel dosya güncel değildir. Bu özellik genellikle önbellek için kullanılır. Varsayılan uygulama her zaman doğru değerini döndürür. Bu nedenle, dosya değişmezse hiçbir zaman güncelliği kontrol etmesi gerekmez.

Parametreler
localFile File: Yerel dosya.

remotePath String: Uzak dosya yolu.

İadeler
boolean Yerel dosya güncelse doğru, değilse yanlış.

Verdiği hatalar
BuildRetrievalError

Korunan yöntemler

clearCache

protected void clearCache ()

downloadFile

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

Parametreler
bucketName String

remoteFilename String

localFile File

Verdiği hatalar
BuildRetrievalError

getStorage

protected Storage getStorage (Collection<String> scopes)

TF seçeneklerine dayalı kimlik bilgilerini desteklemek için temeldeki uygulamayı geçersiz kılın.

Parametreler
scopes Collection: Kimlik bilgisi isteğinde bulunulacak belirli kapsamlar.

İadeler
Storage Storage GCS paketinin nesnesi

Verdiği hatalar
java.io.IOException
IOException

parseGcsPath

protected String[] parseGcsPath (String remotePath)

Parametreler
remotePath String

Döndürülenler
String[]

Verdiği hatalar
BuildRetrievalError