diff --git a/backends-common/opensearch/pom.xml b/backends-common/opensearch/pom.xml
index 55782b45bca..c7c0c196b02 100644
--- a/backends-common/opensearch/pom.xml
+++ b/backends-common/opensearch/pom.xml
@@ -74,7 +74,7 @@
org.apache.logging.log4j
log4j-to-slf4j
- 2.19.0
+ ${log4j2.version}
org.awaitility
diff --git a/backends-common/pulsar/pom.xml b/backends-common/pulsar/pom.xml
index c53d57e7f4f..db5379b750d 100644
--- a/backends-common/pulsar/pom.xml
+++ b/backends-common/pulsar/pom.xml
@@ -32,6 +32,7 @@
2.11.0
2.9.0
+ 2.8.3
@@ -102,12 +103,12 @@
com.typesafe.akka
akka-stream-typed_${scala.base}
- 2.6.20
+ ${akka-stream.version}
com.typesafe.akka
akka-stream_${scala.base}
- 2.6.20
+ ${akka-stream.version}
javax.annotation
diff --git a/examples/custom-healthcheck/pom.xml b/examples/custom-healthcheck/pom.xml
index 172aa2da8c2..afb422c4ca8 100644
--- a/examples/custom-healthcheck/pom.xml
+++ b/examples/custom-healthcheck/pom.xml
@@ -39,7 +39,7 @@
io.projectreactor
reactor-core
- 3.4.18
+ 3.5.8
provided
diff --git a/examples/custom-imap/pom.xml b/examples/custom-imap/pom.xml
index 3ec23666885..51d785d1aec 100644
--- a/examples/custom-imap/pom.xml
+++ b/examples/custom-imap/pom.xml
@@ -71,7 +71,7 @@
com.google.inject
guice
- 5.1.0
+ 6.0.0
provided
diff --git a/examples/metrics-graphite/pom.xml b/examples/metrics-graphite/pom.xml
index cf791cc03e3..5119148668f 100644
--- a/examples/metrics-graphite/pom.xml
+++ b/examples/metrics-graphite/pom.xml
@@ -31,12 +31,12 @@
io.dropwizard.metrics
metrics-graphite
- 4.2.15
+ 4.2.19
com.google.inject
guice
- 5.1.0
+ 6.0.0
provided
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapperRelaxedConsistencyTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapperRelaxedConsistencyTest.java
index efdebf845a1..a71d7318973 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapperRelaxedConsistencyTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapperRelaxedConsistencyTest.java
@@ -21,11 +21,13 @@
import org.apache.james.backends.cassandra.CassandraClusterExtension;
import org.apache.james.backends.cassandra.init.configuration.CassandraConfiguration;
+import org.apache.james.junit.categories.Unstable;
import org.apache.james.mailbox.store.mail.model.MapperProvider;
import org.apache.james.mailbox.store.mail.model.MessageMapperTest;
import org.apache.james.utils.UpdatableTickingClock;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Nested;
+import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.extension.RegisterExtension;
class CassandraMessageMapperRelaxedConsistencyTest {
@@ -51,6 +53,18 @@ protected MapperProvider createMapperProvider() {
protected UpdatableTickingClock updatableTickingClock() {
return cassandraMapperProvider.getUpdatableTickingClock();
}
+
+ @Tag(Unstable.TAG)
+ @Override
+ public void setFlagsShouldWorkWithConcurrencyWithRemove() throws Exception {
+ super.setFlagsShouldWorkWithConcurrencyWithRemove();
+ }
+
+ @Tag(Unstable.TAG)
+ @Override
+ public void userFlagsUpdateShouldWorkInConcurrentEnvironment() throws Exception {
+ super.userFlagsUpdateShouldWorkInConcurrentEnvironment();
+ }
}
@Nested
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapperTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapperTest.java
index 2cf24fbbfc6..012ac06050a 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapperTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapperTest.java
@@ -39,6 +39,7 @@
import org.apache.james.backends.cassandra.StatementRecorder.Selector;
import org.apache.james.backends.cassandra.init.configuration.CassandraConfiguration;
import org.apache.james.blob.api.HashBlobId;
+import org.apache.james.junit.categories.Unstable;
import org.apache.james.mailbox.MessageManager;
import org.apache.james.mailbox.cassandra.ids.CassandraId;
import org.apache.james.mailbox.cassandra.ids.CassandraMessageId;
@@ -65,6 +66,7 @@
import org.assertj.core.api.SoftAssertions;
import org.awaitility.Awaitility;
import org.junit.jupiter.api.Nested;
+import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
@@ -458,4 +460,16 @@ void messagesRetrievedUsingFetchTypeAttachmentsMetadataShouldHaveAttachmentsMeta
assertThat(retrievedMessage.getAttachments()).isEqualTo(message.getAttachments());
}
+
+ @Tag(Unstable.TAG)
+ @Override
+ public void setFlagsShouldWorkWithConcurrencyWithRemove() throws Exception {
+ super.setFlagsShouldWorkWithConcurrencyWithRemove();
+ }
+
+ @Tag(Unstable.TAG)
+ @Override
+ public void userFlagsUpdateShouldWorkInConcurrentEnvironment() throws Exception {
+ super.userFlagsUpdateShouldWorkInConcurrentEnvironment();
+ }
}
diff --git a/mailbox/event/json/pom.xml b/mailbox/event/json/pom.xml
index 3f929bff4bf..6aafd95ac47 100644
--- a/mailbox/event/json/pom.xml
+++ b/mailbox/event/json/pom.xml
@@ -59,7 +59,7 @@
com.beachape
enumeratum_${scala.base}
- 1.7.0
+ 1.7.2
com.chuusai
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java
index a5fe322689d..e60a583f972 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java
@@ -46,6 +46,8 @@
import javax.mail.Flags.Flag;
import org.apache.commons.io.input.TeeInputStream;
+import org.apache.commons.io.input.UnsynchronizedBufferedInputStream;
+import org.apache.commons.io.input.UnsynchronizedFilterInputStream;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.james.events.EventBus;
@@ -107,7 +109,6 @@
import org.apache.james.mime4j.stream.RecursionMode;
import org.apache.james.util.io.BodyOffsetInputStream;
import org.apache.james.util.io.InputStreamConsummer;
-import org.apache.james.util.io.UnsynchronizedBufferedInputStream;
import org.apache.james.util.streams.Iterators;
import org.reactivestreams.Publisher;
@@ -358,7 +359,9 @@ public AppendResult appendMessage(InputStream msgIn, Date internalDate, final Ma
file = Files.createTempFile("imap", ".msg").toFile();
try (FileOutputStream out = new FileOutputStream(file);
BufferedOutputStream bufferedOut = new BufferedOutputStream(out);
- UnsynchronizedBufferedInputStream tmpMsgIn = new UnsynchronizedBufferedInputStream(new TeeInputStream(msgIn, bufferedOut));
+ UnsynchronizedFilterInputStream tmpMsgIn = UnsynchronizedBufferedInputStream.builder()
+ .setInputStream(new TeeInputStream(msgIn, bufferedOut))
+ .get();
BodyOffsetInputStream bIn = new BodyOffsetInputStream(tmpMsgIn)) {
Pair pair = parseProperties(bIn);
PropertyBuilder propertyBuilder = pair.getLeft();
@@ -405,8 +408,10 @@ private Mono appendMessage(Content msgIn, Date internalDate, final
}
try (InputStream contentStream = msgIn.getInputStream();
- UnsynchronizedBufferedInputStream bufferedContentStream = new UnsynchronizedBufferedInputStream(contentStream);
- BodyOffsetInputStream bIn = new BodyOffsetInputStream(bufferedContentStream)) {
+ UnsynchronizedFilterInputStream bufferedContentStream = UnsynchronizedBufferedInputStream.builder()
+ .setInputStream(contentStream)
+ .get();
+ BodyOffsetInputStream bIn = new BodyOffsetInputStream(bufferedContentStream)) {
Pair pair = parseProperties(bIn);
PropertyBuilder propertyBuilder = pair.getLeft();
HeaderImpl headers = pair.getRight();
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/MessageMapperTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/MessageMapperTest.java
index 1efac851eaa..ae93906c491 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/MessageMapperTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/MessageMapperTest.java
@@ -919,8 +919,8 @@ public void userFlagsUpdateShouldWorkInConcurrentEnvironment() throws Exception
saveMessages();
- int threadCount = 2;
- int updateCount = 10;
+ int threadCount = 8;
+ int updateCount = 40;
ConcurrentTestRunner.builder()
.operation((threadNumber, step) -> messageMapper.updateFlags(benwaInboxMailbox, message1.getUid(),
new FlagsUpdateCalculator(new Flags("custom-" + threadNumber + "-" + step), FlagsUpdateMode.ADD)))
@@ -939,8 +939,8 @@ public void setFlagsShouldWorkWithConcurrencyWithRemove() throws Exception {
Assume.assumeTrue(mapperProvider.getSupportedCapabilities().contains(MapperProvider.Capabilities.THREAD_SAFE_FLAGS_UPDATE));
saveMessages();
- int threadCount = 4;
- int updateCount = 20;
+ int threadCount = 8;
+ int updateCount = 40;
ConcurrentTestRunner.builder()
.operation((threadNumber, step) -> {
if (step < updateCount / 2) {
diff --git a/mailet/crypto/src/main/java/org/apache/james/transport/KeyStoreHolder.java b/mailet/crypto/src/main/java/org/apache/james/transport/KeyStoreHolder.java
index 0142293e1b5..7d2dc57012f 100644
--- a/mailet/crypto/src/main/java/org/apache/james/transport/KeyStoreHolder.java
+++ b/mailet/crypto/src/main/java/org/apache/james/transport/KeyStoreHolder.java
@@ -46,7 +46,7 @@
import javax.mail.MessagingException;
-import org.apache.james.util.io.UnsynchronizedBufferedInputStream;
+import org.apache.commons.io.input.UnsynchronizedBufferedInputStream;
import org.bouncycastle.cert.jcajce.JcaCertStoreBuilder;
import org.bouncycastle.cert.selector.X509CertificateHolderSelector;
import org.bouncycastle.cert.selector.jcajce.JcaX509CertSelectorConverter;
@@ -101,7 +101,10 @@ public KeyStoreHolder(String keyStoreFileName, String keyStorePassword, String k
}
keyStore = KeyStore.getInstance(keyStoreType);
- keyStore.load(new UnsynchronizedBufferedInputStream(new FileInputStream(keyStoreFileName)), keyStorePassword.toCharArray());
+ keyStore.load(UnsynchronizedBufferedInputStream
+ .builder()
+ .setInputStream(new FileInputStream(keyStoreFileName))
+ .get(), keyStorePassword.toCharArray());
if (keyStore.size() == 0) {
throw new KeyStoreException("The keystore must be not empty");
}
diff --git a/mailet/crypto/src/main/java/org/apache/james/transport/SMIMEKeyHolder.java b/mailet/crypto/src/main/java/org/apache/james/transport/SMIMEKeyHolder.java
index 5bb18304352..020437a5d61 100644
--- a/mailet/crypto/src/main/java/org/apache/james/transport/SMIMEKeyHolder.java
+++ b/mailet/crypto/src/main/java/org/apache/james/transport/SMIMEKeyHolder.java
@@ -45,7 +45,7 @@
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
-import org.apache.james.util.io.UnsynchronizedBufferedInputStream;
+import org.apache.commons.io.input.UnsynchronizedBufferedInputStream;
import org.bouncycastle.cert.jcajce.JcaCertStore;
import org.bouncycastle.cms.SignerInfoGenerator;
import org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoGeneratorBuilder;
@@ -128,7 +128,11 @@ public SMIMEKeyHolder(String keyStoreFileName, String keyStorePassword, String k
}
KeyStore keyStore = KeyStore.getInstance(keyStoreType);
- keyStore.load(new UnsynchronizedBufferedInputStream(new FileInputStream(keyStoreFileName)), keyStorePassword.toCharArray());
+
+ keyStore.load(UnsynchronizedBufferedInputStream.builder()
+ .setInputStream(new FileInputStream(keyStoreFileName))
+ .get(),
+ keyStorePassword.toCharArray());
Enumeration aliases = keyStore.aliases();
if (keyAlias == null) {
diff --git a/mailet/mailetdocs-maven-plugin/pom.xml b/mailet/mailetdocs-maven-plugin/pom.xml
index 332e0290c4d..e4300c1dcd0 100644
--- a/mailet/mailetdocs-maven-plugin/pom.xml
+++ b/mailet/mailetdocs-maven-plugin/pom.xml
@@ -34,7 +34,9 @@
information available from implementation source.
http://james.apache.org/mailet/maven-mailetdocs-plugin/
2008
-
+
+ 1.12.0
+
${james.groupId}
@@ -64,12 +66,12 @@
org.apache.maven.doxia
doxia-core
- 1.11.1
+ ${doxia.version}
org.apache.maven.doxia
doxia-sink-api
- 1.11.1
+ ${doxia.version}
org.apache.maven.plugin-tools
diff --git a/mailet/standard/src/main/java/org/apache/james/transport/mailets/RecoverAttachment.java b/mailet/standard/src/main/java/org/apache/james/transport/mailets/RecoverAttachment.java
index 87a898bc8f9..1c5a3d862b8 100644
--- a/mailet/standard/src/main/java/org/apache/james/transport/mailets/RecoverAttachment.java
+++ b/mailet/standard/src/main/java/org/apache/james/transport/mailets/RecoverAttachment.java
@@ -30,7 +30,7 @@
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
-import org.apache.james.util.io.UnsynchronizedBufferedInputStream;
+import org.apache.commons.io.input.UnsynchronizedBufferedInputStream;
import org.apache.mailet.AttributeName;
import org.apache.mailet.AttributeUtils;
import org.apache.mailet.AttributeValue;
@@ -119,8 +119,9 @@ private void processAttachment(Mail mail, Map> attach
continue;
}
byte[] bytes = (byte[]) i.next().getValue();
- InputStream is = new UnsynchronizedBufferedInputStream(
- new ByteArrayInputStream(bytes));
+ InputStream is = UnsynchronizedBufferedInputStream.builder()
+ .setInputStream(new ByteArrayInputStream(bytes))
+ .get();
MimeBodyPart p = new MimeBodyPart(is);
if (!(message.isMimeType("multipart/*") && (message
.getContent() instanceof MimeMultipart))) {
diff --git a/pom.xml b/pom.xml
index bbea10ea761..fb4cea036f7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -598,45 +598,45 @@
org.apache.james
${james.groupId}.protocols
- 5.17.3
+ 5.18.2
0.8.9
3.2.0
10.14.2.0
- 2.19.0
+ 2.20.0
1
javax.activation
activation
0.8
4.3.25.RELEASE
- 2.27.1
+ 2.29.0
1.0.3
1.5.4
1.1.1
- 2.0.6
+ 2.0.7
3.5.2
- 5.8.2
- 1.8.2
- 5.8.2
+ 5.9.3
+ 1.9.3
+ 5.9.3
1.3.4
4.21
4.1.94.Final
2.4.0
1.6.4
- 2.14.1
- 2.14.1
- 11.10
+ 2.15.2
+ 2.15.2
+ 12.4
3.8.0
0.11.5
- 4.2.15
+ 4.2.19
1.17.6
2.2.1
6.0.0-RC3
- 31.1-jre
+ 32.1.1-jre
1.0.0
- 4.5.13
+ 4.5.14
3.0-alpha-1
3.6.4
@@ -650,19 +650,20 @@
2.3.1
3.6.2
1.9.3
- 5.1.0
- 1.4.5
- 1.7.0
+ 6.0.0
+ 1.4.8
+ 1.9.0
6.2.4.RELEASE
1.70
2.13
- ${scala.base}.10
+ ${scala.base}.11
5.0.0
none
- 4.8.0
+ 5.2.0
0.8.9
+ 2.38.0
@@ -2122,7 +2123,7 @@
com.github.ben-manes.caffeine
caffeine
- 3.1.2
+ 3.1.6
com.github.dpaukov
@@ -2196,7 +2197,7 @@
com.jayway.jsonpath
json-path
- 2.7.0
+ 2.8.0
com.jcraft
@@ -2252,12 +2253,12 @@
com.typesafe.play
play-json_${scala.base}
- 2.9.3
+ 2.9.4
com.unboundid
unboundid-ldapsdk
- 6.0.7
+ 6.0.9
commons-beanutils
@@ -2278,7 +2279,7 @@
commons-daemon
commons-daemon
- 1.3.3
+ 1.3.4
commons-dbcp
@@ -2294,7 +2295,7 @@
commons-io
commons-io
- 2.11.0
+ 2.13.0
commons-net
@@ -2314,7 +2315,7 @@
eu.timepit
refined_${scala.base}
- 0.10.3
+ 0.11.0
io.cucumber
@@ -2354,7 +2355,7 @@
io.github.hakky54
sslcontext-kickstart-for-pem
- 7.4.7
+ 8.1.2
io.github.openfeign
@@ -2436,7 +2437,7 @@
io.projectreactor
reactor-bom
- 2022.0.8
+ 2022.0.9
pom
import
@@ -2453,7 +2454,7 @@
io.rest-assured
rest-assured
- 5.3.0
+ 5.3.1
commons-logging
@@ -2496,15 +2497,20 @@
jaxb-api
${jaxb.version}
+
+ net.javacrumbs.json-unit
+ json-unit
+ ${javacrumbs.json-unit.version}
+
net.javacrumbs.json-unit
json-unit-assertj
- 2.36.0
+ ${javacrumbs.json-unit.version}
nl.jqno.equalsverifier
equalsverifier
- 3.10.1
+ 3.15
org.apache.activemq
@@ -2541,7 +2547,7 @@
org.apache.ant
ant
- 1.10.12
+ 1.10.13
org.apache.commons
@@ -2551,12 +2557,12 @@
org.apache.commons
commons-compress
- 1.22
+ 1.23.0
org.apache.commons
commons-configuration2
- 2.8.0
+ 2.9.0
commons-logging
@@ -2679,7 +2685,7 @@
org.apache.pdfbox
pdfbox
- 2.0.27
+ 2.0.29
commons-logging
@@ -2705,7 +2711,7 @@
org.assertj
assertj-core
- 3.23.1
+ 3.24.2
org.awaitility
@@ -2741,7 +2747,7 @@
org.jsoup
jsoup
- 1.15.3
+ 1.16.1
org.julienrf
@@ -2781,7 +2787,7 @@
org.mock-server
mockserver-netty
- 5.14.0
+ 5.15.0
io.netty
@@ -2817,7 +2823,7 @@
org.scalatest
scalatest_${scala.base}
- 3.2.14
+ 3.2.16
org.slf4j
@@ -3075,7 +3081,7 @@
org.scalameta
semanticdb-scalac_${scala.version}
- 4.6.0
+ 4.8.4
diff --git a/protocols/imap/pom.xml b/protocols/imap/pom.xml
index b70e5523481..b11ec65fcc6 100644
--- a/protocols/imap/pom.xml
+++ b/protocols/imap/pom.xml
@@ -110,7 +110,7 @@
it.unimi.dsi
fastutil-core
- 8.5.9
+ 8.5.12
org.apache.commons
diff --git a/server/blob/blob-s3/pom.xml b/server/blob/blob-s3/pom.xml
index 951301625f1..dee65d25146 100644
--- a/server/blob/blob-s3/pom.xml
+++ b/server/blob/blob-s3/pom.xml
@@ -33,7 +33,7 @@
Apache James :: Server :: Blob :: S3
- 2.20.98
+ 2.20.103
diff --git a/server/container/core/src/main/java/org/apache/james/server/core/MimeMessageInputStreamSource.java b/server/container/core/src/main/java/org/apache/james/server/core/MimeMessageInputStreamSource.java
index 4ba872108da..58f4d4e1c6f 100644
--- a/server/container/core/src/main/java/org/apache/james/server/core/MimeMessageInputStreamSource.java
+++ b/server/container/core/src/main/java/org/apache/james/server/core/MimeMessageInputStreamSource.java
@@ -33,10 +33,10 @@
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
+import org.apache.commons.io.input.UnsynchronizedBufferedInputStream;
import org.apache.commons.io.output.DeferredFileOutputStream;
import org.apache.james.lifecycle.api.Disposable;
import org.apache.james.util.SizeFormat;
-import org.apache.james.util.io.UnsynchronizedBufferedInputStream;
/**
* Takes an input stream and creates a repeatable input stream source for a
@@ -186,7 +186,10 @@ public InputStream getInputStream() throws IOException {
if (getResource().getOut().isInMemory()) {
return new ByteArrayInputStream(getResource().getOut().getData());
} else {
- InputStream in = new UnsynchronizedBufferedInputStream(new FileInputStream(getResource().getOut().getFile()), 2048);
+ InputStream in = UnsynchronizedBufferedInputStream.builder()
+ .setInputStream(new FileInputStream(getResource().getOut().getFile()))
+ .setBufferSize(2048)
+ .get();
getResource().streams.add(in);
return in;
}
diff --git a/server/container/util/src/main/java/org/apache/james/util/io/UnsynchronizedBufferedInputStream.java b/server/container/util/src/main/java/org/apache/james/util/io/UnsynchronizedBufferedInputStream.java
deleted file mode 100644
index cab709cc83b..00000000000
--- a/server/container/util/src/main/java/org/apache/james/util/io/UnsynchronizedBufferedInputStream.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one *
- * or more contributor license agreements. See the NOTICE file *
- * distributed with this work for additional information *
- * regarding copyright ownership. The ASF licenses this file *
- * to you under the Apache License, Version 2.0 (the *
- * "License"); you may not use this file except in compliance *
- * with the License. You may obtain a copy of the License at *
- * *
- * http://www.apache.org/licenses/LICENSE-2.0 *
- * *
- * Unless required by applicable law or agreed to in writing, *
- * software distributed under the License is distributed on an *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
- * KIND, either express or implied. See the License for the *
- * specific language governing permissions and limitations *
- * under the License. *
- ****************************************************************/
-
-package org.apache.james.util.io;
-
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * Copied from {@link java.io.BufferedInputStream} with the following modifications:
- * - Removal of 'synchronized' keyword
- * - Removal of 'volatile' keyword
- * - Removal of Unsafe usages
- *
- * See https://issues.apache.org/jira/projects/IO/issues/IO-786 for rationals
- */
-public class UnsynchronizedBufferedInputStream extends FilterInputStream {
- private static int DEFAULT_BUFFER_SIZE = 8192;
- private static int MAX_BUFFER_SIZE = 2147483639;
- protected byte[] buf;
- protected int count;
- protected int pos;
- protected int markpos;
- protected int marklimit;
-
- private InputStream getInIfOpen() throws IOException {
- InputStream input = this.in;
- if (input == null) {
- throw new IOException("Stream closed");
- } else {
- return input;
- }
- }
-
- private byte[] getBufIfOpen() throws IOException {
- byte[] buffer = this.buf;
- if (buffer == null) {
- throw new IOException("Stream closed");
- } else {
- return buffer;
- }
- }
-
- public UnsynchronizedBufferedInputStream(InputStream in) {
- this(in, DEFAULT_BUFFER_SIZE);
- }
-
- public UnsynchronizedBufferedInputStream(InputStream in, int size) {
- super(in);
- this.markpos = -1;
- if (size <= 0) {
- throw new IllegalArgumentException("Buffer size <= 0");
- } else {
- this.buf = new byte[size];
- }
- }
-
- private void fill() throws IOException {
- byte[] buffer = this.getBufIfOpen();
- int nsz;
- if (this.markpos < 0) {
- this.pos = 0;
- } else if (this.pos >= buffer.length) {
- if (this.markpos > 0) {
- nsz = this.pos - this.markpos;
- System.arraycopy(buffer, this.markpos, buffer, 0, nsz);
- this.pos = nsz;
- this.markpos = 0;
- } else if (buffer.length >= this.marklimit) {
- this.markpos = -1;
- this.pos = 0;
- } else {
- if (buffer.length >= MAX_BUFFER_SIZE) {
- throw new OutOfMemoryError("Required array size too large");
- }
-
- nsz = this.pos <= MAX_BUFFER_SIZE - this.pos ? this.pos * 2 : MAX_BUFFER_SIZE;
- if (nsz > this.marklimit) {
- nsz = this.marklimit;
- }
-
- byte[] nbuf = new byte[nsz];
- System.arraycopy(buffer, 0, nbuf, 0, this.pos);
-
- buffer = nbuf;
- }
- }
-
- this.count = this.pos;
- nsz = this.getInIfOpen().read(buffer, this.pos, buffer.length - this.pos);
- if (nsz > 0) {
- this.count = nsz + this.pos;
- }
-
- }
-
- public int read() throws IOException {
- if (this.pos >= this.count) {
- this.fill();
- if (this.pos >= this.count) {
- return -1;
- }
- }
-
- return this.getBufIfOpen()[this.pos++] & 255;
- }
-
- private int read1(byte[] b, int off, int len) throws IOException {
- int avail = this.count - this.pos;
- if (avail <= 0) {
- if (len >= this.getBufIfOpen().length && this.markpos < 0) {
- return this.getInIfOpen().read(b, off, len);
- }
-
- this.fill();
- avail = this.count - this.pos;
- if (avail <= 0) {
- return -1;
- }
- }
-
- int cnt = avail < len ? avail : len;
- System.arraycopy(this.getBufIfOpen(), this.pos, b, off, cnt);
- this.pos += cnt;
- return cnt;
- }
-
- public int read(byte[] b, int off, int len) throws IOException {
- this.getBufIfOpen();
- if ((off | len | off + len | b.length - (off + len)) < 0) {
- throw new IndexOutOfBoundsException();
- } else if (len == 0) {
- return 0;
- } else {
- int n = 0;
-
- InputStream input;
- do {
- int nread = this.read1(b, off + n, len - n);
- if (nread <= 0) {
- return n == 0 ? nread : n;
- }
-
- n += nread;
- if (n >= len) {
- return n;
- }
-
- input = this.in;
- } while (input == null || input.available() > 0);
-
- return n;
- }
- }
-
- public long skip(long n) throws IOException {
- this.getBufIfOpen();
- if (n <= 0L) {
- return 0L;
- } else {
- long avail = (long)(this.count - this.pos);
- if (avail <= 0L) {
- if (this.markpos < 0) {
- return this.getInIfOpen().skip(n);
- }
-
- this.fill();
- avail = (long)(this.count - this.pos);
- if (avail <= 0L) {
- return 0L;
- }
- }
-
- long skipped = avail < n ? avail : n;
- this.pos = (int)((long)this.pos + skipped);
- return skipped;
- }
- }
-
- public int available() throws IOException {
- int n = this.count - this.pos;
- int avail = this.getInIfOpen().available();
- return n > 2147483647 - avail ? 2147483647 : n + avail;
- }
-
- public void mark(int readlimit) {
- this.marklimit = readlimit;
- this.markpos = this.pos;
- }
-
- public void reset() throws IOException {
- this.getBufIfOpen();
- if (this.markpos < 0) {
- throw new IOException("Resetting to invalid mark");
- } else {
- this.pos = this.markpos;
- }
- }
-
- public boolean markSupported() {
- return true;
- }
-
- public void close() throws IOException {
- while (true) {
- byte[] buffer;
- if ((buffer = this.buf) != null) {
-
- InputStream input = this.in;
- this.in = null;
- if (input != null) {
- input.close();
- }
-
- return;
- }
-
- return;
- }
- }
-}
diff --git a/server/mailet/integration-testing/pom.xml b/server/mailet/integration-testing/pom.xml
index 521a3e5daeb..bde166d48a1 100644
--- a/server/mailet/integration-testing/pom.xml
+++ b/server/mailet/integration-testing/pom.xml
@@ -32,6 +32,10 @@
Apache James :: Server :: Mailet :: Integration Testing
+
+ 2.9.1
+
+
${james.groupId}
@@ -138,12 +142,12 @@
org.xmlunit
xmlunit-core
- 2.9.0
+ ${xmlunit.version}
org.xmlunit
xmlunit-matchers
- 2.9.0
+ ${xmlunit.version}
diff --git a/server/mailet/mailets/pom.xml b/server/mailet/mailets/pom.xml
index b415acb5624..16cdc776f59 100644
--- a/server/mailet/mailets/pom.xml
+++ b/server/mailet/mailets/pom.xml
@@ -33,7 +33,7 @@
Apache James :: Server :: Mailets
- 4.17.0
+ 4.20.0
diff --git a/server/protocols/jmap-draft/pom.xml b/server/protocols/jmap-draft/pom.xml
index d6f1525d758..00e4378c284 100644
--- a/server/protocols/jmap-draft/pom.xml
+++ b/server/protocols/jmap-draft/pom.xml
@@ -266,7 +266,7 @@
org.jgrapht
jgrapht-core
- 1.5.1
+ 1.5.2
org.jsoup
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SecurityKeyLoader.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SecurityKeyLoader.java
index e1b4660591e..b3fd1022002 100644
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SecurityKeyLoader.java
+++ b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SecurityKeyLoader.java
@@ -40,9 +40,9 @@
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
-import nl.altindag.ssl.exception.CertificateParseException;
+import nl.altindag.ssl.pem.exception.PemParseException;
+import nl.altindag.ssl.pem.util.PemUtils;
import nl.altindag.ssl.util.KeyStoreUtils;
-import nl.altindag.ssl.util.PemUtils;
public class SecurityKeyLoader {
private static final String ALIAS = "james";
@@ -104,7 +104,7 @@ private PublicKey loadPublicKey() throws IOException {
fileSystem.getResource(jmapDraftConfiguration.getCertificates().get()))
.get(0);
return certificate.getPublicKey();
- } catch (CertificateParseException e) {
+ } catch (PemParseException e) {
String publicKeyAsString = IOUtils.toString(fileSystem.getResource(jmapDraftConfiguration.getCertificates().get()), StandardCharsets.US_ASCII);
return new PublicKeyReader()
.fromPEM(publicKeyAsString)
diff --git a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/pom.xml b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/pom.xml
index ef6b172cbeb..35d750d7b32 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/pom.xml
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/pom.xml
@@ -65,7 +65,7 @@
com.softwaremill.sttp.client3
okhttp-backend_${scala.base}
- 3.6.2
+ 3.8.16
com.typesafe.play
diff --git a/server/protocols/jmap-rfc-8621/pom.xml b/server/protocols/jmap-rfc-8621/pom.xml
index c5594234231..72fd65a56b9 100644
--- a/server/protocols/jmap-rfc-8621/pom.xml
+++ b/server/protocols/jmap-rfc-8621/pom.xml
@@ -185,7 +185,7 @@
org.typelevel
cats-core_${scala.base}
- 2.8.0
+ 2.9.0
diff --git a/server/protocols/jwt/pom.xml b/server/protocols/jwt/pom.xml
index d664bcc3f57..4ba4aa91446 100644
--- a/server/protocols/jwt/pom.xml
+++ b/server/protocols/jwt/pom.xml
@@ -40,7 +40,7 @@
com.auth0
jwks-rsa
- 0.21.1
+ 0.22.0
com.fasterxml.jackson.core
diff --git a/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/IMAPServerTest.java b/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/IMAPServerTest.java
index 551e0e34326..c05aa98d88c 100644
--- a/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/IMAPServerTest.java
+++ b/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/IMAPServerTest.java
@@ -124,7 +124,7 @@
import io.netty.handler.codec.compression.ZlibWrapper;
import io.netty.handler.ssl.SslContextBuilder;
import nl.altindag.ssl.exception.GenericKeyStoreException;
-import nl.altindag.ssl.exception.PrivateKeyParseException;
+import nl.altindag.ssl.pem.exception.PrivateKeyParseException;
import reactor.core.publisher.Mono;
import reactor.core.scheduler.Schedulers;
import reactor.netty.Connection;
diff --git a/server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/LegacyJavaEncryptionFactory.java b/server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/LegacyJavaEncryptionFactory.java
index 206a64f7c9f..491653ce426 100644
--- a/server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/LegacyJavaEncryptionFactory.java
+++ b/server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/LegacyJavaEncryptionFactory.java
@@ -40,8 +40,8 @@
import com.github.fge.lambdas.Throwing;
import nl.altindag.ssl.SSLFactory;
-import nl.altindag.ssl.trustmanager.TrustStoreTrustOptions;
-import nl.altindag.ssl.util.PemUtils;
+import nl.altindag.ssl.pem.util.PemUtils;
+import nl.altindag.ssl.trustmanager.trustoptions.TrustStoreTrustOptions;
public class LegacyJavaEncryptionFactory implements Encryption.Factory {
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractConfigurableAsyncServer.class);
diff --git a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/VacationRoutesTest.java b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/VacationRoutesTest.java
index 6aa94768651..15a2e781a0e 100755
--- a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/VacationRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/VacationRoutesTest.java
@@ -148,8 +148,8 @@ void postVacationCreates() {
SoftAssertions.assertSoftly(softly -> {
softly.assertThat(vacation).isNotNull();
softly.assertThat(vacation.isEnabled()).isTrue();
- softly.assertThat(vacation.getFromDate()).isEqualTo(Optional.of(ZonedDateTime.parse("2021-09-20T10:00:00Z[UTC]")));
- softly.assertThat(vacation.getToDate()).isEqualTo(Optional.of(ZonedDateTime.parse("2021-09-27T18:00:00Z[UTC]")));
+ softly.assertThat(vacation.getFromDate()).isEqualTo(Optional.of(ZonedDateTime.parse("2021-09-20T10:00:00Z")));
+ softly.assertThat(vacation.getToDate()).isEqualTo(Optional.of(ZonedDateTime.parse("2021-09-27T18:00:00Z")));
softly.assertThat(vacation.getSubject()).isEqualTo(Optional.of("On vacation again"));
softly.assertThat(vacation.getTextBody()).isEqualTo(Optional.of("Need more vacation!"));
softly.assertThat(vacation.getHtmlBody()).isEqualTo(Optional.of("Need more vacation!
"));
@@ -176,8 +176,8 @@ void postVacationUpdatesAll() throws Exception {
SoftAssertions.assertSoftly(softly -> {
softly.assertThat(vacation).isNotNull();
softly.assertThat(vacation.isEnabled()).isTrue();
- softly.assertThat(vacation.getFromDate()).isEqualTo(Optional.of(ZonedDateTime.parse("2021-09-20T10:00:00Z[UTC]")));
- softly.assertThat(vacation.getToDate()).isEqualTo(Optional.of(ZonedDateTime.parse("2021-09-27T18:00:00Z[UTC]")));
+ softly.assertThat(vacation.getFromDate()).isEqualTo(Optional.of(ZonedDateTime.parse("2021-09-20T10:00:00Z")));
+ softly.assertThat(vacation.getToDate()).isEqualTo(Optional.of(ZonedDateTime.parse("2021-09-27T18:00:00Z")));
softly.assertThat(vacation.getSubject()).isEqualTo(Optional.of("On vacation again"));
softly.assertThat(vacation.getTextBody()).isEqualTo(Optional.of("Need more vacation!"));
softly.assertThat(vacation.getHtmlBody()).isEqualTo(Optional.of("Need more vacation!
"));
diff --git a/server/protocols/webadmin/webadmin-dropwizard-metrics/pom.xml b/server/protocols/webadmin/webadmin-dropwizard-metrics/pom.xml
index d1d669820bc..d858521a6c4 100644
--- a/server/protocols/webadmin/webadmin-dropwizard-metrics/pom.xml
+++ b/server/protocols/webadmin/webadmin-dropwizard-metrics/pom.xml
@@ -33,6 +33,10 @@
HTTP endpoint to expose dropwizard collected metrics. This endpoint is intended to be called by
Prometheus.
+
+ 0.16.0
+
+
${james.groupId}
@@ -61,12 +65,12 @@
io.prometheus
simpleclient_dropwizard
- 0.15.0
+ ${prometheus.version}
io.prometheus
simpleclient_servlet
- 0.15.0
+ ${prometheus.version}
io.rest-assured
diff --git a/server/queue/queue-pulsar/pom.xml b/server/queue/queue-pulsar/pom.xml
index 7e9cbd7bc53..19c8c6e4771 100644
--- a/server/queue/queue-pulsar/pom.xml
+++ b/server/queue/queue-pulsar/pom.xml
@@ -101,7 +101,7 @@
com.clever-cloud.pulsar4s
pulsar4s-play-json_${scala.base}
- 2.8.1
+ 2.9.0
com.typesafe.play