티스토리 뷰
class S3(
var bucketName: String? = null,
var key: String? = null,
val accessKey: String? = null,
val secretKey: String? = null,
val region: String? = null
)
fun delete(
s3: S3,
keyword: String = "",
) {
with(s3) {
val client = client(accessKey, secretKey, region)
var objects = client.listObjects(bucketName, key)
while (true) {
for (i in objects.objectSummaries) {
if (!i.key.contains(keyword)) {
continue
}
client.deleteObject(bucketName, i.key)
}
if (objects.isTruncated) {
objects = client.listNextBatchOfObjects(objects)
} else {
break
}
}
var versions = client.listVersions(bucketName, key)
while (true) {
for (i in versions.versionSummaries) {
if (!i.key.contains(keyword)) {
continue
}
client.deleteVersion(bucketName, i.key, i.versionId)
}
if (versions.isTruncated) {
versions = client.listNextBatchOfVersions(versions)
} else {
break
}
}
}
}
Delete files, directories and buckets in amazon s3 java
I'm wondering how to do this. I looked at the sdk documentation and have some examples, but am confused how the syntax generally goes. If I want to delete a file, I assume I use deleteObject(path...
stackoverflow.com
https://stackoverflow.com/questions/68035269/delete-all-versions-of-an-object-s3-using-java
Delete all versions of an object S3 using java
I want to delete all versions of an object with a given key using software.amazon.awssdk.s3 v2. So far I found out there is no such deleteAllVersions(key), you have to get all versionIds of your ob...
stackoverflow.com
https://docs.aws.amazon.com/ko_kr/AmazonS3/latest/userguide/delete-objects.html
단일 객체 삭제 - Amazon Simple Storage Service
다음 예제에서는 버킷에서 버전 관리를 사용하지 않고 객체에 버전 ID가 없다고 가정합니다. 삭제 요청 시, 객체 키만 지정하며 버전 ID는 지정하지 않습니다. 실제 예제를 작성 및 테스트하는 방
docs.aws.amazon.com
'공부' 카테고리의 다른 글
[git] branch remove all exclude (main | master | release) (0) | 2023.01.24 |
---|---|
[hive] table get `location` (0) | 2023.01.24 |
[mongoose] MongooseServerSelectionError: connect ECONNREFUSED ::1:27017 (0) | 2023.01.24 |
[js] node & npm & yarn (0) | 2023.01.24 |
[linux] Unable to fetch some archives, maybe run apt-get update or try with --fix-missing (0) | 2023.01.24 |
- Total
- Today
- Yesterday
- 개리마커스
- Bot
- 테슬라 추천
- 책그림
- 테슬라 리퍼럴 코드 생성
- 어떻게 능력을 보여줄 것인가?
- 테슬라 리퍼럴 코드
- wlw
- 유투브
- follower
- 김달
- 모델 Y 레퍼럴
- 팔로워 수 세기
- 테슬라 크레딧 사용
- 연애학개론
- 인스타그램
- 모델y
- 테슬라 레퍼럴 적용 확인
- Kluge
- 테슬라 레퍼럴 코드 확인
- 테슬라
- 레퍼럴
- 테슬라 레퍼럴
- 클루지
- 메디파크 내과 전문의 의학박사 김영수
- 할인
- COUNT
- 테슬라 리퍼럴 코드 혜택
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |