mirror of
https://github.com/halo-dev/plugin-s3.git
synced 2025-10-16 15:30:00 +00:00
Compare commits
2 Commits
v1.13.0-rc
...
v1.13.0
Author | SHA1 | Date | |
---|---|---|---|
![]() |
42e27da86b | ||
![]() |
19469d0537 |
11
build.gradle
11
build.gradle
@@ -1,17 +1,8 @@
|
|||||||
// TODO Remove the buildscript block when the halo devtools plugin is updated to use ASM 9.5 or later.
|
|
||||||
buildscript {
|
|
||||||
dependencies {
|
|
||||||
// force the version of ASM used by the halo devtools plugin
|
|
||||||
classpath('org.ow2.asm:asm:9.8')
|
|
||||||
classpath('org.ow2.asm:asm-commons:9.8')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'java'
|
||||||
id "com.github.node-gradle.node" version "7.1.0"
|
id "com.github.node-gradle.node" version "7.1.0"
|
||||||
id "io.freefair.lombok" version "8.13.1"
|
id "io.freefair.lombok" version "8.13.1"
|
||||||
id "run.halo.plugin.devtools" version "0.5.0"
|
id "run.halo.plugin.devtools" version "0.6.0"
|
||||||
id 'org.openapi.generator' version '7.12.0'
|
id 'org.openapi.generator' version '7.12.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
pluginManagement {
|
pluginManagement {
|
||||||
repositories {
|
repositories {
|
||||||
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots' }
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/spring-plugin' }
|
maven { url 'https://maven.aliyun.com/repository/spring-plugin' }
|
||||||
@@ -9,4 +8,3 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
rootProject.name = 'plugin-s3'
|
rootProject.name = 'plugin-s3'
|
||||||
|
|
||||||
|
@@ -91,13 +91,16 @@ public class S3OsAttachmentHandler implements AttachmentHandler {
|
|||||||
return Mono.just(context);
|
return Mono.just(context);
|
||||||
}
|
}
|
||||||
var properties = S3OsProperties.convertFrom(deleteContext.configMap());
|
var properties = S3OsProperties.convertFrom(deleteContext.configMap());
|
||||||
return Mono.using(() -> buildS3Client(properties),
|
return Mono.using(
|
||||||
|
() -> buildS3Client(properties),
|
||||||
client -> Mono.fromCallable(
|
client -> Mono.fromCallable(
|
||||||
() -> client.deleteObject(DeleteObjectRequest.builder()
|
() -> client.deleteObject(DeleteObjectRequest.builder()
|
||||||
.bucket(properties.getBucket())
|
.bucket(properties.getBucket())
|
||||||
.key(objectKey)
|
.key(objectKey)
|
||||||
.build())).subscribeOn(Schedulers.boundedElastic()),
|
.build())),
|
||||||
S3Client::close)
|
S3Client::close
|
||||||
|
)
|
||||||
|
.subscribeOn(Schedulers.boundedElastic())
|
||||||
.doOnNext(response -> {
|
.doOnNext(response -> {
|
||||||
checkResult(response, "delete object");
|
checkResult(response, "delete object");
|
||||||
log.info("Delete object {} from bucket {} successfully",
|
log.info("Delete object {} from bucket {} successfully",
|
||||||
@@ -105,8 +108,10 @@ public class S3OsAttachmentHandler implements AttachmentHandler {
|
|||||||
})
|
})
|
||||||
.thenReturn(context);
|
.thenReturn(context);
|
||||||
})
|
})
|
||||||
|
// ignore when the object does not exist
|
||||||
|
.onErrorComplete(NoSuchKeyException.class::isInstance)
|
||||||
.onErrorMap(S3ExceptionHandler::map)
|
.onErrorMap(S3ExceptionHandler::map)
|
||||||
.map(DeleteContext::attachment);
|
.thenReturn(deleteContext.attachment());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user