GCSBucketUtil
public
class
GCSBucketUtil
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.util.GCSBucketUtil |
Google Cloud Storage'dan (GCS) dosya indirmek ve yüklemek için dosya yöneticisi.
Bu sınıf, test kapsamında (ör. IRemoteTest). Bu politikanın desteği sonlandırıldı. Lütfen bunun yerine GCSFileDownloader politikasını kullanın.
Özet
İç içe yerleştirilmiş sınıflar | |
|---|---|
class |
GCSBucketUtil.GCSFileMetadata
GCS'deki dosya bilgileri için basit sarmalayıcı. |
Herkese açık oluşturucular | |
|---|---|
GCSBucketUtil(String bucketName)
|
|
Herkese açık yöntemler | |
|---|---|
CommandResult
|
copy(String source, String dest)
Bir dosyayı veya dizini pakete kopyalayın. |
int
|
getAttempts()
|
String
|
getBotoConfig()
|
String
|
getBotoPath()
|
String
|
getBucketName()
|
boolean
|
getNoClobber()
|
boolean
|
getParallel()
|
boolean
|
getRecursive()
|
long
|
getRetryInterval()
|
long
|
getTimeout()
|
boolean
|
isFile(String path)
Bir GCS dosyasının dosya mı yoksa klasör mü olduğunu kontrol edin. |
List<String>
|
ls(Path bucketPath)
Bir GCS yolu altındaki dosyaları listeler. |
CommandResult
|
makeBucket(String projectId)
GCS paketini oluşturun. |
String
|
md5Hash(File localFile)
Yerel dosyanın MD5 karma değerini hesaplayın. |
CommandResult
|
pull(Path bucketPath)
Bir dosyayı veya dizini GCS paketinden geçerli dizine indirin. |
CommandResult
|
pull(Path bucketPath, File localFile)
GCS paketinden dosya veya dizin indirme |
String
|
pullContents(Path bucketPath)
GCS paketinden dosya indirme ve içeriğini çıkarma |
CommandResult
|
push(File localFile)
Yerel bir dosyayı veya dizini GCS paketine yükleyin. |
CommandResult
|
push(File localFile, Path bucketPath)
Yerel bir dosyayı veya dizini belirli bir yola sahip GCS paketine yükleyin. |
CommandResult
|
pushString(String contents, Path bucketPath)
Bir dizeyi GCS paketine yükleyin. |
CommandResult
|
remove(String pattern, boolean force)
Dosyayı veya dizini paketten kaldırma |
CommandResult
|
remove(Path path, boolean force)
Dosyayı veya dizini paketten kaldırma |
CommandResult
|
remove(Path path)
Dosyayı veya dizini paketten kaldırma |
CommandResult
|
remove(String pattern)
Dosyayı veya dizini paketten kaldırma |
CommandResult
|
removeBucket()
GCS paketini kaldırma |
void
|
setAttempts(int attempts)
|
void
|
setBotoConfig(String botoConfig)
|
void
|
setBotoPath(String botoPath)
|
void
|
setBucketName(String bucketName)
|
void
|
setNoClobber(boolean noClobber)
|
void
|
setParallel(boolean parallel)
|
void
|
setRecursive(boolean recursive)
|
void
|
setRetryInterval(long retryInterval)
|
void
|
setTimeout(long timeout, TimeUnit unit)
|
void
|
setTimeoutMs(long timeout)
|
GCSBucketUtil.GCSFileMetadata
|
stat(Path bucketPath)
GCS yolu için dosyanın durumunu alın. |
Korunan yöntemler | |
|---|---|
IRunUtil
|
getRunUtil()
|
Herkese açık oluşturucular
GCSBucketUtil
public GCSBucketUtil (String bucketName)
| Parametreler | |
|---|---|
bucketName |
String |
Herkese açık yöntemler
kopyala
public CommandResult copy (String source, String dest)
Bir dosyayı veya dizini pakete kopyalayın.
| Parametreler | |
|---|---|
source |
String: Kaynak dosya veya desen |
dest |
String: Hedef dosya veya desen |
| İadeler | |
|---|---|
CommandResult |
CommandResult işleminin sonucu. |
| Verdiği hatalar | |
|---|---|
IOException |
|
getAttempts
public int getAttempts ()
| İadeler | |
|---|---|
int |
|
getBotoConfig
public String getBotoConfig ()
| İadeler | |
|---|---|
String |
|
getBotoPath
public String getBotoPath ()
| İadeler | |
|---|---|
String |
|
getBucketName
public String getBucketName ()
| İadeler | |
|---|---|
String |
|
getNoClobber
public boolean getNoClobber ()
| İadeler | |
|---|---|
boolean |
|
getParallel
public boolean getParallel ()
| İadeler | |
|---|---|
boolean |
|
getRecursive
public boolean getRecursive ()
| İadeler | |
|---|---|
boolean |
|
getRetryInterval
public long getRetryInterval ()
| İadeler | |
|---|---|
long |
|
getTimeout
public long getTimeout ()
| İadeler | |
|---|---|
long |
|
isFile
public boolean isFile (String path)
Bir GCS dosyasının dosya mı yoksa klasör mü olduğunu kontrol edin.
Dosya adı "/" ile bitiyorsa bu bir klasördür. gs://dosyaadı bir dosya ise gsutil ls gs://dosyaadı komutu gs://dosyaadı değerini döndürmelidir. gs://klasöradı bir klasör ise ve klasörde dosyalar varsa gsutil ls gs://klasöradı komutu klasördeki dosyaları döndürmelidir. Klasörde dosya yoksa gs://folder/ döndürülür.
| Parametreler | |
|---|---|
path |
String: Paketle ilgili göreli yol. |
| İadeler | |
|---|---|
boolean |
Dosya olup olmadığını |
| Verdiği hatalar | |
|---|---|
|
java.io.IOException |
IOException |
|
ls
public List<String> ls (Path bucketPath)
Bir GCS yolu altındaki dosyaları listeler.
| Parametreler | |
|---|---|
bucketPath |
Path: GCS yolu |
| İadeler | |
|---|---|
List<String> |
GCS yolu altındaki dosyalar olan String listesi |
| Verdiği hatalar | |
|---|---|
|
java.io.IOException |
IOException |
|
makeBucket
public CommandResult makeBucket (String projectId)
GCS paketini oluşturun.
| Parametreler | |
|---|---|
projectId |
String |
| İadeler | |
|---|---|
CommandResult |
CommandResult işleminin sonucu. |
| Verdiği hatalar | |
|---|---|
|
java.io.IOException |
IOException |
|
md5Hash
public String md5Hash (File localFile)
Yerel dosyanın MD5 karma değerini hesaplayın.
| Parametreler | |
|---|---|
localFile |
File: Yerel bir dosya |
| İadeler | |
|---|---|
String |
Yerel dosyanın MD5 karması. |
| Verdiği hatalar | |
|---|---|
|
java.io.IOException |
IOException |
|
pull
public CommandResult pull (Path bucketPath)
Bir dosyayı veya dizini GCS paketinden geçerli dizine indirin.
| Parametreler | |
|---|---|
bucketPath |
Path: GCS paketindeki dosya yolu |
| İadeler | |
|---|---|
CommandResult |
CommandResult işleminin sonucu. |
| Verdiği hatalar | |
|---|---|
IOException |
|
pull
public CommandResult pull (Path bucketPath, File localFile)
GCS paketinden dosya veya dizin indirme
| Parametreler | |
|---|---|
bucketPath |
Path: GCS paketindeki dosya yolu |
localFile |
File: Yerel hedef yolu |
| İadeler | |
|---|---|
CommandResult |
CommandResult işleminin sonucu. |
| Verdiği hatalar | |
|---|---|
IOException |
|
pullContents
public String pullContents (Path bucketPath)
GCS paketinden dosya indirme ve içeriğini çıkarma
| Parametreler | |
|---|---|
bucketPath |
Path: GCS paketindeki dosya yolu |
| İadeler | |
|---|---|
String |
Dosyanın dize içerikleri |
| Verdiği hatalar | |
|---|---|
IOException |
|
push
public CommandResult push (File localFile)
Yerel bir dosyayı veya dizini GCS paketine yükleyin.
| Parametreler | |
|---|---|
localFile |
File: Yerel dosya veya dizin |
| İadeler | |
|---|---|
CommandResult |
CommandResult işleminin sonucu. |
| Verdiği hatalar | |
|---|---|
IOException |
|
push
public CommandResult push (File localFile, Path bucketPath)
Yerel bir dosyayı veya dizini belirli bir yola sahip GCS paketine yükleyin.
| Parametreler | |
|---|---|
localFile |
File: Yerel dosya veya dizin |
bucketPath |
Path: GCS paketindeki dosya yolu |
| İadeler | |
|---|---|
CommandResult |
CommandResult işleminin sonucu. |
| Verdiği hatalar | |
|---|---|
IOException |
|
pushString
public CommandResult pushString (String contents, Path bucketPath)
Bir dizeyi GCS paketine yükleyin.
| Parametreler | |
|---|---|
contents |
String: Dosya içeriği (dize olarak) |
bucketPath |
Path: GCS paketindeki dosya yolu |
| İadeler | |
|---|---|
CommandResult |
CommandResult işleminin sonucu. |
| Verdiği hatalar | |
|---|---|
IOException |
|
remove
public CommandResult remove (String pattern, boolean force)
Dosyayı veya dizini paketten kaldırma
| Parametreler | |
|---|---|
pattern |
String: Kaldırılacak dosya, dizin veya desen. |
force |
boolean: Hataların yoksayılıp sessizce devam edilip edilmeyeceği (hata oluşturulmaz) |
| İadeler | |
|---|---|
CommandResult |
|
| Verdiği hatalar | |
|---|---|
IOException |
|
remove
public CommandResult remove (Path path, boolean force)
Dosyayı veya dizini paketten kaldırma
| Parametreler | |
|---|---|
path |
Path: Kaldırılacak yol |
force |
boolean: Dosya yoksa başarısız olup olmayacağı |
| İadeler | |
|---|---|
CommandResult |
|
| Verdiği hatalar | |
|---|---|
IOException |
|
remove
public CommandResult remove (Path path)
Dosyayı veya dizini paketten kaldırma
| Parametreler | |
|---|---|
path |
Path: Kaldırılacak yol |
| İadeler | |
|---|---|
CommandResult |
|
| Verdiği hatalar | |
|---|---|
IOException |
|
remove
public CommandResult remove (String pattern)
Dosyayı veya dizini paketten kaldırma
| Parametreler | |
|---|---|
pattern |
String: Kaldırılacak dosya, dizin veya desen. |
| İadeler | |
|---|---|
CommandResult |
|
| Verdiği hatalar | |
|---|---|
IOException |
|
removeBucket
public CommandResult removeBucket ()
GCS paketini kaldırma
| İadeler | |
|---|---|
CommandResult |
|
| Verdiği hatalar | |
|---|---|
|
java.io.IOException |
IOException |
|
setAttempts
public void setAttempts (int attempts)
| Parametreler | |
|---|---|
attempts |
int |
setBotoConfig
public void setBotoConfig (String botoConfig)
| Parametreler | |
|---|---|
botoConfig |
String |
setBotoPath
public void setBotoPath (String botoPath)
| Parametreler | |
|---|---|
botoPath |
String |
setBucketName
public void setBucketName (String bucketName)
| Parametreler | |
|---|---|
bucketName |
String |
setNoClobber
public void setNoClobber (boolean noClobber)
| Parametreler | |
|---|---|
noClobber |
boolean |
setParallel
public void setParallel (boolean parallel)
| Parametreler | |
|---|---|
parallel |
boolean |
setRecursive
public void setRecursive (boolean recursive)
| Parametreler | |
|---|---|
recursive |
boolean |
setRetryInterval
public void setRetryInterval (long retryInterval)
| Parametreler | |
|---|---|
retryInterval |
long |
setTimeout
public void setTimeout (long timeout,
TimeUnit unit)| Parametreler | |
|---|---|
timeout |
long |
unit |
TimeUnit |
setTimeoutMs
public void setTimeoutMs (long timeout)
| Parametreler | |
|---|---|
timeout |
long |
stat
public GCSBucketUtil.GCSFileMetadata stat (Path bucketPath)
GCS yolu için dosyanın durumunu alın.
| Parametreler | |
|---|---|
bucketPath |
Path: GCS yolu |
| İadeler | |
|---|---|
GCSBucketUtil.GCSFileMetadata |
GCS yolu için GCSFileMetadata |
| Verdiği hatalar | |
|---|---|
|
java.io.IOException |
IOException |
|