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(File jsonKeyFile)
GCSFileDownloader(File jsonKeyFile, Boolean createEmptyFile)
GCSFileDownloader(Boolean createEmptyFile)

เมธอดสาธารณะ

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)

เครื่องมือสร้างสาธารณะ

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

เมธอดสาธารณะ

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: เส้นทาง GCS ในรูปแบบ gs://bucket/file/path

การคืนสินค้า
File ไฟล์ในเครื่อง

ส่ง
com.android.tradefed.build.BuildRetrievalError
BuildRetrievalError

isFresh

public boolean isFresh (File localFile, 
                String remotePath)

ตรวจสอบความใหม่ของไฟล์ในเครื่อง หากไฟล์ในเครื่องเหมือนกับไฟล์ระยะไกล แสดงว่าไฟล์เป็นเวอร์ชันล่าสุด หากไม่เป็นเช่นนั้น ไฟล์ในเครื่องจะไม่มีอัปเดต โดยส่วนใหญ่จะใช้สำหรับแคช การติดตั้งใช้งานเริ่มต้นจะ แสดงผลเป็นจริงเสมอ ดังนั้นหากไฟล์ไม่เปลี่ยนแปลง ก็ไม่จำเป็นต้องตรวจสอบความใหม่

พารามิเตอร์
localFile File: ไฟล์ในเครื่อง

remotePath String: เส้นทางไฟล์ระยะไกล

การคืนสินค้า
boolean เป็นจริงหากไฟล์ในเครื่องเป็นไฟล์ล่าสุด ไม่เช่นนั้นจะเป็นเท็จ

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

ลบล้างการติดตั้งใช้งานในฐานเพื่อรองรับข้อมูลเข้าสู่ระบบตามตัวเลือก TF

พารามิเตอร์
scopes Collection: ขอบเขตที่เฉพาะเจาะจงเพื่อขอข้อมูลเข้าสู่ระบบ

การคืนสินค้า
Storage Storage ออบเจ็กต์ของที่เก็บข้อมูล GCS

ส่ง
java.io.IOException
IOException

parseGcsPath

protected String[] parseGcsPath (String remotePath)

พารามิเตอร์
remotePath String

การคืนสินค้า
String[]

ส่ง
BuildRetrievalError