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에는 두 가지 유형의 폴더가 있습니다. 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)
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 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)"],[],[]]