GCSFileUploader

public class GCSFileUploader
extends GCSCommon

java.lang.Object
   ↳ com.android.tradefed.util.gcs.GCSCommon
     ↳ com.android.tradefed.util.GCSFileUploader


โปรแกรมอัปโหลดไฟล์เพื่ออัปโหลดข้อมูลไฟล์ไปยัง Google Cloud Storage (GCS)

สรุป

ตัวสร้างแบบสาธารณะ

GCSFileUploader()
GCSFileUploader(File jsonKeyFile)

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

void uploadFile(String bucketName, String gcsFilename, InputStream fileContents, String contentType, boolean allowOverwrite)

อัปโหลดข้อมูลไปยังไฟล์ที่เก็บข้อมูล GCS

วิธีการที่มีการป้องกัน

Storage getStorage( scopes)

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

ตัวสร้างแบบสาธารณะ

GCSFileUploader

public GCSFileUploader ()

GCSFileUploader

public GCSFileUploader (File jsonKeyFile)

พารามิเตอร์
jsonKeyFile File

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

uploadFile

public void uploadFile (String bucketName, 
                String gcsFilename, 
                InputStream fileContents, 
                String contentType, 
                boolean allowOverwrite)

อัปโหลดข้อมูลไปยังไฟล์ที่เก็บข้อมูล GCS gs://[ชื่อที่เก็บข้อมูล]/[ชื่อไฟล์ GCS]

พารามิเตอร์
bucketName String: ชื่อที่เก็บข้อมูล GCS

gcsFilename String: ชื่อไฟล์

fileContents InputStream: InputStream ของข้อมูลที่เขียนลงในไฟล์ GCS

contentType String: คือประเภทสื่อ MIME ของออบเจ็กต์ที่อัปโหลด

allowOverwrite boolean: True จะอนุญาตให้เมธอดนี้เขียนทับไฟล์ใน GCS

วิธีการที่มีการป้องกัน

getStorage

protected Storage getStorage ( scopes)

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

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

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

โยน
IOException