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).

סיכום

‫constructors ציבוריים

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

‫methods ציבוריים

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(Collection<String> scopes)

עקיפת ההטמעה בבסיס כדי לתמוך באישור על סמך אפשרויות TF.

String[] parseGcsPath(String remotePath)

‫constructors ציבוריים

GCSFileDownloader

public GCSFileDownloader ()

GCSFileDownloader

public GCSFileDownloader (File jsonKeyFile)

פרמטרים
jsonKeyFile File

GCSFileDownloader

public GCSFileDownloader (File jsonKeyFile, 
                Boolean createEmptyFile)

פרמטרים
jsonKeyFile File

createEmptyFile Boolean

GCSFileDownloader

public GCSFileDownloader (Boolean createEmptyFile)

פרמטרים
createEmptyFile Boolean

‫methods ציבוריים

createTempFileForRemote

public static File createTempFileForRemote (String remoteFilePath, 
                File rootDir)

פרמטרים
remoteFilePath String

rootDir File

החזרות
File

הקפצת הודעות שגיאה (throw)
BuildRetrievalError

downloadFile

public void downloadFile (String remotePath, 
                File destFile)

פרמטרים
remotePath String

destFile File

הקפצת הודעות שגיאה (throw)
BuildRetrievalError

downloadFile

public File downloadFile (String remoteFilePath)

הורדת קובץ מ-GCS.

בשלב הזה יש תמיכה רק בנתיב GCS.

פרמטרים
remoteFilePath String: נתיב GCS בפורמט gs://bucket/file/path.

החזרות
File קובץ מקומי

הקפצת הודעות שגיאה (throw)
com.android.tradefed.build.BuildRetrievalError
BuildRetrievalError

isFresh

public boolean isFresh (File localFile, 
                String remotePath)

בודקים את רמת העדכניות של הקובץ המקומי. אם הקובץ המקומי זהה לקובץ המרוחק, הוא עדכני. אם לא, הקובץ המקומי לא עדכני. הוא משמש בעיקר למטמון. ההטמעה שמוגדרת כברירת מחדל תמיד תחזיר את הערך True, כך שאם הקובץ הוא בלתי ניתן לשינוי, לא תהיה צורך לבדוק את הטריות שלו.

פרמטרים
localFile File: קובץ מקומי.

remotePath String: הנתיב של הקובץ המרוחק.

החזרות
boolean ‫True אם הקובץ המקומי חדש, אחרת False.

הקפצת הודעות שגיאה (throw)
BuildRetrievalError

שיטות מוגנות

clearCache

protected void clearCache ()

downloadFile

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

פרמטרים
bucketName String

remoteFilename String

localFile File

הקפצת הודעות שגיאה (throw)
BuildRetrievalError

getStorage

protected Storage getStorage (Collection<String> scopes)

עקיפת ההטמעה בבסיס כדי לתמוך באישור על סמך אפשרויות TF.

פרמטרים
scopes Collection: היקפים ספציפיים לבקשת פרטי כניסה.

החזרות
Storage אובייקט Storage של קטגוריית GCS

הקפצת הודעות שגיאה (throw)
java.io.IOException
IOException

parseGcsPath

protected String[] parseGcsPath (String remotePath)

פרמטרים
remotePath String

החזרות
String[]

הקפצת הודעות שגיאה (throw)
BuildRetrievalError