GCS檔案上傳器
public class GCSFileUploader
extends GCSCommon
java.lang.Object | ||
↳ | com.android.tradefed.util.GCSCommon | |
↳ | com.android.tradefed.util.GCSFileUploader |
文件上傳器將文件資料上傳到Google雲端儲存(GCS)。
概括
公共構造函數 | |
---|---|
GCSFileUploader (File jsonKeyFile) | |
GCSFileUploader () |
公共方法 | |
---|---|
void | uploadFile (String bucketName, String gcsFilename, InputStream fileContents, String contentType, boolean allowOverwrite) 將資料上傳到 GCS 儲存桶檔案。 |
公共構造函數
GCS檔案上傳器
public GCSFileUploader (File jsonKeyFile)
參數 | |
---|---|
jsonKeyFile | File |
GCS檔案上傳器
public GCSFileUploader ()
公共方法
上傳文件
public void uploadFile (String bucketName, String gcsFilename, InputStream fileContents, String contentType, boolean allowOverwrite)
將資料上傳到 GCS 儲存桶檔案。 gs://[bucketName]/[gcsFileName]
參數 | |
---|---|
bucketName | String : GCS 儲存桶名稱 |
gcsFilename | String :檔案名。 |
fileContents | InputStream :要寫入 GCS 檔案的資料的輸入流。 |
contentType | String :是正在上傳的物件的 MIME 媒體類型。 |
allowOverwrite | boolean :True 將允許此方法覆寫 GCS 上的檔案。 |