GCS (जीसीएस)फ़ाइल डाउनलोडर

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

सार्वजनिक तरीके

static File createTempFileForRemote(String remoteFilePath, File rootDir)
void downloadFile(String remotePath, File destFile)

GCS (जीसीएस) बकेट फ़ाइल से कोई फ़ाइल डाउनलोड करें.

File downloadFile(String remoteFilePath)

GCS (जीसीएस) से फ़ाइल डाउनलोड करें.

boolean isFresh(File localFile, String remotePath)

देखें कि फ़ाइल कितनी अप-टू-डेट है.

सुरक्षित तरीके

void clearCache()
void downloadFile(String bucketName, String remoteFilename, File localFile)
Storage getStorage( scopes)

टीएफ़ विकल्पों के आधार पर क्रेडेंशियल की सुविधा देने के लिए, बेस में लागू करने की प्रक्रिया को बदलें.

String[] parseGcsPath(String remotePath)

सार्वजनिक कंस्ट्रक्टर

GCS (जीसीएस)फ़ाइल डाउनलोडर

public GCSFileDownloader (Boolean createEmptyFile)

पैरामीटर
createEmptyFile Boolean

GCS (जीसीएस)फ़ाइल डाउनलोडर

public GCSFileDownloader ()

GCS (जीसीएस)फ़ाइल डाउनलोडर

public GCSFileDownloader (File jsonKeyFile)

पैरामीटर
jsonKeyFile File

सार्वजनिक तरीके

createTempFileForRemote

public static File createTempFileForRemote (String remoteFilePath, 
                File rootDir)

पैरामीटर
remoteFilePath String

rootDir File

रिटर्न
File

थ्रो
BuildRetrievalError

डाउनलोड फ़ाइल

public void downloadFile (String remotePath, 
                File destFile)

GCS (जीसीएस) बकेट फ़ाइल से कोई फ़ाइल डाउनलोड करें.

पैरामीटर
remotePath String: GCS बकेट का नाम

destFile File: फ़ाइल का नाम

रिटर्न
void फ़ाइल के कॉन्टेंट के साथ ERROR(/InputStream).

थ्रो
BuildRetrievalError

डाउनलोड फ़ाइल

public File downloadFile (String remoteFilePath)

GCS (जीसीएस) से फ़ाइल डाउनलोड करें.

अभी सिर्फ़ GCS पाथ काम करता है.

पैरामीटर
remoteFilePath String: gs://bucket/file/path फ़ॉर्मैट GCS पाथ.

रिटर्न
File डिवाइस पर मौजूद फ़ाइल

थ्रो
com.android.tradefed.build.BuildRetrievalError
BuildRetrievalError

isFresh

public boolean isFresh (File localFile, 
                String remotePath)

देखें कि फ़ाइल कितनी अप-टू-डेट है. अगर लोकल फ़ाइल और रिमोट फ़ाइल, दोनों एक ही हैं, तो नई फ़ाइल नई होती है. अगर आपने नहीं, लोकल फ़ाइल पुरानी है. इसका इस्तेमाल खास तौर पर कैश मेमोरी के लिए किया जाता है. डिफ़ॉल्ट रूप से लागू होने पर हमेशा 'सही' दिखाता है, इसलिए अगर फ़ाइल में बदलाव नहीं किया जा सकता, तो उसे अपडेट होने की जांच करने की ज़रूरत कभी नहीं होगी.

पैरामीटर
localFile File: लोकल फ़ाइल.

remotePath String: रिमोट फ़ाइल पाथ.

रिटर्न
boolean सही है अगर लोकल फ़ाइल नई है, नहीं तो गलत है.

थ्रो
BuildRetrievalError

सुरक्षित तरीके

कैश मेमोरी मिटाएं

protected void clearCache ()

डाउनलोड फ़ाइल

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

पैरामीटर
bucketName String

remoteFilename String

localFile File

थ्रो
BuildRetrievalError

'पाने वाला' फ़ील्ड

protected Storage getStorage ( scopes)

टीएफ़ विकल्पों के आधार पर क्रेडेंशियल की सुविधा देने के लिए, बेस में लागू करने की प्रक्रिया को बदलें.

पैरामीटर
scopes : वे खास दायरे जिनके लिए क्रेडेंशियल का अनुरोध किया जा सकता है.

रिटर्न
Storage GCS बकेट का Storage ऑब्जेक्ट

थ्रो
IOअपवाद

पार्सGcsPath

protected String[] parseGcsPath (String remotePath)

पैरामीटर
remotePath String

रिटर्न
String[]

थ्रो
BuildRetrievalError