2026 年より、トランク安定版開発モデルに沿ってエコシステムのプラットフォームの安定性を確保するため、第 2 四半期と第 4 四半期に AOSP にソースコードを公開します。AOSP のビルドとコントリビューションには、aosp-main ではなく android-latest-release を使用することをおすすめします。android-latest-release マニフェスト ブランチは、常に AOSP にプッシュされた最新のリリースを参照します。詳細については、AOSP の変更点をご覧ください。
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
GCSFileDownloaderBase
public
class
GCSFileDownloaderBase
extends GCSCommon
Google Cloud Storage(GCS)からファイルをダウンロードするファイル ダウンローダー。
概要
定数
GCS_APPROX_PREFIX
public static final String GCS_APPROX_PREFIX
定数値:
"gs:/"
GCS_PREFIX
public static final String GCS_PREFIX
定数値:
"gs://"
フィールド
mCreateEmptyFile
protected Boolean mCreateEmptyFile
パブリック コンストラクタ
GCSFileDownloaderBase
public GCSFileDownloaderBase ()
GCSFileDownloaderBase
public GCSFileDownloaderBase (Boolean createEmptyFile)
| パラメータ |
createEmptyFile |
Boolean |
パブリック メソッド
createTempFileForRemote
public static File createTempFileForRemote (String remoteFilePath,
File rootDir)
指定されたパスでダウンロードされたファイルを格納する一意のファイルを一時ディスクに作成します。
パスのベース ファイル名に基づいてファイル名を構築します
| パラメータ |
remoteFilePath |
String: 名前の作成元となるリモートパス |
rootDir |
File |
downloadFile
public InputStream downloadFile (String bucketName,
String filename)
GCS バケット ファイルからファイルをダウンロードします。
| パラメータ |
bucketName |
String: GCS バケット名 |
filename |
String: ファイル名 |
downloadFile
public void downloadFile (String remotePath,
File destFile)
| パラメータ |
remotePath |
String |
destFile |
File |
downloadFile
public File downloadFile (String remoteFilePath)
| パラメータ |
remoteFilePath |
String |
public StorageObject getRemoteFileMetaData (String bucketName,
String remoteFilename)
| パラメータ |
bucketName |
String |
remoteFilename |
String |
isRemoteFolder
public boolean isRemoteFolder (String bucketName,
String filename)
指定されたファイル名がフォルダかどうかを確認します。
gcs には次の 2 種類のフォルダがあります。1. UI から明示的に作成された。フォルダはサイズ 0 のテキスト ファイル(オブジェクト)です。2. ファイルをアップロードすると、その親フォルダがすべて作成されますが、これらのフォルダは gcs に存在しません(オブジェクトではありません)。この関数はどちらの場合でも機能します。ただし、サイズが 0 のフォルダをダウンロードしようとすべきではありません。
| パラメータ |
bucketName |
String: GCS バケット名です。 |
filename |
String: バケットの相対パス。 |
| 戻り値 |
boolean |
ファイル名がフォルダの場合は true、それ以外の場合は false。 |
sanitizeDirectoryName
public String sanitizeDirectoryName (String name)
保護されたメソッド
createTempFile
protected File createTempFile (String remoteFilePath,
File rootDir)
| パラメータ |
remoteFilePath |
String |
rootDir |
File |
downloadFile
protected void downloadFile (String bucketName,
String remoteFilename,
File localFile)
| パラメータ |
bucketName |
String |
remoteFilename |
String |
localFile |
File |
getStorage
protected Storage getStorage ()
listRemoteFilesUnderFolder
protected void listRemoteFilesUnderFolder (String bucketName,
String folder,
subFiles,
subFolders)
| パラメータ |
bucketName |
String |
folder |
String |
subFiles |
|
subFolders |
|
parseGcsPath
protected String[] parseGcsPath (String remotePath)
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-12-04 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-12-04 UTC。"],[],[]]