2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
GCSFileDownloader
public
class
GCSFileDownloader
extends GCSFileDownloaderBase
implements
IFileDownloader
Google Cloud Storage (GCS)에서 파일을 다운로드하는 파일 다운로더입니다.
요약
공개 생성자
GCSFileDownloader
public GCSFileDownloader ()
GCSFileDownloader
public GCSFileDownloader (Boolean createEmptyFile)
매개변수 |
createEmptyFile |
Boolean |
GCSFileDownloader
public GCSFileDownloader (File jsonKeyFile)
공개 메서드
createTempFileForRemote
public static File createTempFileForRemote (String remoteFilePath,
File rootDir)
매개변수 |
remoteFilePath |
String |
rootDir |
File |
downloadFile
public void downloadFile (String remotePath,
File destFile)
매개변수 |
remotePath |
String |
destFile |
File |
downloadFile
public File downloadFile (String remoteFilePath)
GCS에서 파일을 다운로드합니다.
현재 GCS 경로만 지원됩니다.
매개변수 |
remoteFilePath |
String : gs://bucket/file/path 형식의 GCS 경로입니다. |
isFresh
public boolean isFresh (File localFile,
String remotePath)
로컬 파일의 최신 상태를 확인합니다. 로컬 파일이 원격 파일과 동일하면 최신 파일입니다. 그렇지 않으면 로컬 파일이 비활성 상태입니다. 주로 캐시에 사용됩니다. 기본 구현은 항상 true를 반환하므로 파일이 변경 불가능한 경우 최신성을 확인할 필요가 없습니다.
매개변수 |
localFile |
File : 로컬 파일입니다. |
remotePath |
String : 원격 파일 경로입니다. |
반환 값 |
boolean |
로컬 파일이 최신 상태인 경우 true, 그렇지 않은 경우 false입니다. |
보호된 메서드
clearCache
protected void clearCache ()
downloadFile
protected void downloadFile (String bucketName,
String remoteFilename,
File localFile)
매개변수 |
bucketName |
String |
remoteFilename |
String |
localFile |
File |
getStorage
protected Storage getStorage ( scopes)
TF 옵션에 따라 사용자 인증 정보를 지원하도록 기본 구현을 재정의합니다.
매개변수 |
scopes |
: 사용자 인증 정보를 요청할 특정 범위입니다. |
parseGcsPath
protected String[] parseGcsPath (String remotePath)
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-03-26(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-03-26(UTC)"],[],[]]