From b6987ce75b2328cd8b5292a75a531b56fd555825 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 6 Feb 2024 08:00:38 -0500 Subject: [PATCH] POM updates --- pom.xml | 9 ++++----- .../artifact_manager_jclouds/JCloudsVirtualFile.java | 5 ++++- .../plugins/artifact_manager_jclouds/s3/S3BlobStore.java | 4 ---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index 7b08ae7c..86e30231 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 4.76 + 4.77 io.jenkins.plugins @@ -96,7 +96,7 @@ software.amazon.awssdk sso - 2.22.2 + 2.23.17 test @@ -137,7 +137,7 @@ org.jenkins-ci.test docker-fixtures - 178.v2c7d2343886b_ + 190.vd6a_e600cb_775 test @@ -194,7 +194,6 @@ org.kohsuke.metainf-services metainf-services - 1.11 test @@ -244,7 +243,7 @@ org.testcontainers testcontainers - 1.19.3 + 1.19.4 test diff --git a/src/main/java/io/jenkins/plugins/artifact_manager_jclouds/JCloudsVirtualFile.java b/src/main/java/io/jenkins/plugins/artifact_manager_jclouds/JCloudsVirtualFile.java index 27a0b1ab..209fb0c8 100644 --- a/src/main/java/io/jenkins/plugins/artifact_manager_jclouds/JCloudsVirtualFile.java +++ b/src/main/java/io/jenkins/plugins/artifact_manager_jclouds/JCloudsVirtualFile.java @@ -364,7 +364,10 @@ public static boolean delete(BlobStoreProvider provider, BlobStore blobStore, St List paths = new ArrayList<>(); for (StorageMetadata sm : BlobStores.listAll(blobStore, provider.getContainer(), ListContainerOptions.Builder.prefix(prefix).recursive())) { String path = sm.getName(); - assert path.startsWith(prefix); + if (!path.startsWith(prefix)) { + LOGGER.warning(() -> path + " does not start with " + prefix); + continue; + } paths.add(path); } if (paths.isEmpty()) { diff --git a/src/main/java/io/jenkins/plugins/artifact_manager_jclouds/s3/S3BlobStore.java b/src/main/java/io/jenkins/plugins/artifact_manager_jclouds/s3/S3BlobStore.java index 88f90871..03f6664d 100644 --- a/src/main/java/io/jenkins/plugins/artifact_manager_jclouds/s3/S3BlobStore.java +++ b/src/main/java/io/jenkins/plugins/artifact_manager_jclouds/s3/S3BlobStore.java @@ -188,8 +188,6 @@ private Supplier getCredentialsSupplier() throws IOException { @NonNull @Override public URI toURI(@NonNull String container, @NonNull String key) { - assert container != null; - assert key != null; try { AmazonS3ClientBuilder builder = getConfiguration().getAmazonS3ClientBuilder(); URI uri = builder.build().getUrl(container, key).toURI(); @@ -206,8 +204,6 @@ public URI toURI(@NonNull String container, @NonNull String key) { */ @Override public URL toExternalURL(@NonNull Blob blob, @NonNull HttpMethod httpMethod) throws IOException { - assert blob != null; - assert httpMethod != null; AmazonS3ClientBuilder builder = getConfiguration().getAmazonS3ClientBuilderWithCredentials(); Date expiration = new Date(System.currentTimeMillis() + TimeUnit.HOURS.toMillis(1));