james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [8/9] james-project git commit: JAMES-2270 Replace uses of considered-deprecated constants
Date Wed, 03 Jan 2018 03:20:42 GMT
JAMES-2270 Replace uses of considered-deprecated constants

In Java 7+ projects, constants within com.google.common.base.Charsets
are considered deprecated, and the corresponding constants from
StandardCharsets are preferred.

These changes were suggested by the Extra Hints plugin for NetBeans:
http://plugins.netbeans.org/plugin/73447/


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/ba1dd277
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/ba1dd277
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/ba1dd277

Branch: refs/heads/master
Commit: ba1dd277db91d269e4bafca3d15feeafdec7b775
Parents: d7134dd
Author: Daniel Trebbien <dtrebbien@gmail.com>
Authored: Sat Dec 23 15:27:20 2017 -0800
Committer: benwa <btellier@linagora.com>
Committed: Wed Jan 3 10:18:53 2018 +0700

----------------------------------------------------------------------
 .../james/mailbox/model/AttachmentTest.java     |   5 +-
 .../CassandraMessageIdManagerTestSystem.java    |   4 +-
 .../james/mailbox/cassandra/ids/BlobIdTest.java |   6 +-
 .../cassandra/mail/CassandraBlobsDAOTest.java   |  22 ++--
 .../cassandra/mail/CassandraMessageDAOTest.java |  15 ++-
 .../AttachmentMessageIdCreationTest.java        |   3 +-
 .../cassandra/mail/utils/DataChunkerTest.java   |  10 +-
 .../ElasticSearchIntegrationTest.java           |  12 +-
 .../json/MessageToElasticSearchJsonTest.java    |   6 +-
 .../mailbox/inmemory/JsoupTextExtractor.java    |   6 +-
 .../InMemoryMessageIdManagerTestSystem.java     |   4 +-
 .../InMemoryMessageManagerTestSystem.java       |   4 +-
 .../mailbox/store/search/PDFTextExtractor.java  |   4 +-
 .../store/extractor/DefaultTextExtractor.java   |   5 +-
 .../PartContentBuilderComplexMultipartTest.java |   7 +-
 ...tContentBuilderMultipartAlternativeTest.java |   7 +-
 .../store/mail/model/AttachmentMapperTest.java  |  36 +++---
 .../mailbox/store/mail/model/MessageAssert.java |  14 +--
 .../model/impl/SimpleMailboxMessageTest.java    |  12 +-
 .../search/AbstractMessageSearchIndexTest.java  |   4 +-
 .../mailbox/tika/TikaTextExtractorTest.java     |  10 +-
 .../mailet/base/test/MimeMessageBuilder.java    |   4 +-
 .../james/transport/mailets/SMIMEDecrypt.java   |   4 +-
 .../transport/mailets/ICALToJsonAttribute.java  |   4 +-
 .../james/transport/mailets/model/ICAL.java     |   4 +-
 .../mailets/ICALToJsonAttributeTest.java        |  14 +--
 .../james/transport/mailets/LogMessage.java     |   4 +-
 .../mailets/utils/MimeMessageModifier.java      |   6 +-
 .../mailets/AmqpForwardAttributeTest.java       |   3 +-
 .../transport/mailets/ContentReplacerTest.java  |  12 +-
 .../james/transport/mailets/LogMessageTest.java |   5 +-
 .../mailets/MimeDecodingMailetTest.java         |   6 +-
 .../transport/mailets/ReplaceContentTest.java   |   5 +-
 .../transport/mailets/StripAttachmentTest.java  |   9 +-
 mdn/src/main/java/org/apache/james/mdn/MDN.java |   4 +-
 .../test/java/org/apache/james/mdn/MDNTest.java |   9 +-
 .../apache/james/mpt/smtp/ForwardSmtpTest.java  |   4 +-
 .../imap/decode/ImapRequestLineReaderTest.java  |   8 +-
 .../decode/parser/CreateCommandParserTest.java  |   9 +-
 .../parser/GetAnnotationCommandParserTest.java  |  69 +++++-----
 .../AllButStartTlsDelimiterChannelHandler.java  |   4 +-
 .../protocols/smtp/AbstractSMTPServerTest.java  |   4 +-
 .../apache/james/cli/util/OutputCapture.java    |   5 +-
 .../james/cli/util/OutputCaptureTest.java       |  10 +-
 .../java/org/apache/james/ESReporterTest.java   |   6 +-
 .../java/org/apache/james/jmap/JMAPModule.java  |   4 +-
 .../james/AbstractJmapJamesServerTest.java      |   4 +-
 .../adapter/mailbox/MailboxManagementTest.java  |   7 +-
 .../util/mime/MessageContentExtractorTest.java  |  31 +++--
 .../james/sieve/cassandra/model/Script.java     |   4 +-
 .../james/sieve/cassandra/model/ScriptTest.java |   6 +-
 .../GatewayRemoteDeliveryIntegrationTest.java   |   4 +-
 .../james/smtp/SmtpAuthorizedAddressesTest.java |   5 +-
 .../mailets/AmqpForwardAttachmentTest.java      |   5 +-
 .../mailets/ICSAttachmentWorkflowTest.java      |  12 +-
 .../james/transport/mailets/amqp/AmqpRule.java  |   4 +-
 .../mailets/delivery/MailDispatcherTest.java    |   4 +-
 .../managesieve/ManageSieveMailetTestCase.java  |   4 +-
 .../james/jmap/JMAPAuthenticationTest.java      |   4 +-
 .../jmap/UserProvisionningConcurrencyTest.java  |   6 +-
 .../james/jmap/VacationIntegrationTest.java     |   6 +-
 .../jmap/VacationRelayIntegrationTest.java      |   4 +-
 .../integration/GetMailboxesMethodTest.java     |   6 +-
 .../integration/GetMessageListMethodTest.java   |  10 +-
 .../integration/GetVacationResponseTest.java    |   6 +-
 .../integration/SetMailboxesMethodTest.java     |   7 +-
 .../integration/SetMessagesMethodTest.java      | 126 +++++++++----------
 .../integration/SetVacationResponseTest.java    |   6 +-
 .../integration/cucumber/DownloadStepdefs.java  |   8 +-
 .../cucumber/GetMessagesMethodStepdefs.java     |   4 +-
 .../integration/cucumber/MainStepdefs.java      |   4 +-
 .../integration/cucumber/UploadStepdefs.java    |   4 +-
 .../integration/cucumber/UserStepdefs.java      |   4 +-
 .../org/apache/james/jmap/JMAPServletTest.java  |   4 +-
 .../jmap/methods/GetMessagesMethodTest.java     |  46 +++----
 .../james/jmap/model/MessageFactoryTest.java    |  48 +++----
 .../apache/james/jmap/send/MailFactoryTest.java |   4 +-
 .../netty/ChannelManageSieveResponseWriter.java |   5 +-
 .../integration/JwtFilterIntegrationTest.java   |   6 +-
 .../WebAdminServerIntegrationTest.java          |   4 +-
 .../routes/CassandraMigrationRoutesTest.java    |   4 +-
 .../webadmin/routes/GlobalQuotaRoutesTest.java  |   4 +-
 .../routes/UserMailboxesRoutesTest.java         |   4 +-
 .../apache/james/utils/SMTPMessageSender.java   |   4 +-
 84 files changed, 415 insertions(+), 425 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/api/src/test/java/org/apache/james/mailbox/model/AttachmentTest.java
----------------------------------------------------------------------
diff --git a/mailbox/api/src/test/java/org/apache/james/mailbox/model/AttachmentTest.java b/mailbox/api/src/test/java/org/apache/james/mailbox/model/AttachmentTest.java
index f45da47..5a7fa24 100644
--- a/mailbox/api/src/test/java/org/apache/james/mailbox/model/AttachmentTest.java
+++ b/mailbox/api/src/test/java/org/apache/james/mailbox/model/AttachmentTest.java
@@ -24,15 +24,14 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.InputStream;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.commons.io.IOUtils;
 import org.junit.Test;
 
-import com.google.common.base.Charsets;
-
 public class AttachmentTest {
 
-    private static Charset CHARSET = Charsets.UTF_8;
+    private static Charset CHARSET = StandardCharsets.UTF_8;
 
     @Test
     public void streamShouldBeConsumedOneTime() throws Exception {

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraMessageIdManagerTestSystem.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraMessageIdManagerTestSystem.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraMessageIdManagerTestSystem.java
index 4f35016..54ec881 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraMessageIdManagerTestSystem.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraMessageIdManagerTestSystem.java
@@ -19,6 +19,7 @@
 
 package org.apache.james.mailbox.cassandra;
 
+import java.nio.charset.StandardCharsets;
 import java.util.Date;
 
 import javax.mail.Flags;
@@ -46,12 +47,11 @@ import org.apache.james.mailbox.store.mail.model.impl.SimpleMailboxMessage;
 import org.apache.james.mailbox.store.quota.ListeningCurrentQuotaUpdater;
 import org.apache.james.mailbox.store.quota.StoreCurrentQuotaManager;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Throwables;
 
 public class CassandraMessageIdManagerTestSystem extends MessageIdManagerTestSystem {
 
-    private static final byte[] MESSAGE_CONTENT = "subject: any\n\nbody".getBytes(Charsets.UTF_8);
+    private static final byte[] MESSAGE_CONTENT = "subject: any\n\nbody".getBytes(StandardCharsets.UTF_8);
 
     public static MessageIdManagerTestSystem createTestingData(CassandraCluster cassandra, QuotaManager quotaManager, MailboxEventDispatcher dispatcher) throws Exception {
         CassandraMailboxSessionMapperFactory mapperFactory = CassandraTestSystemFixture.createMapperFactory(cassandra);

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/ids/BlobIdTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/ids/BlobIdTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/ids/BlobIdTest.java
index 0261274..808871b 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/ids/BlobIdTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/ids/BlobIdTest.java
@@ -21,13 +21,13 @@ package org.apache.james.mailbox.cassandra.ids;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
+import java.nio.charset.StandardCharsets;
+
 import org.apache.commons.io.IOUtils;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 
-import com.google.common.base.Charsets;
-
 import nl.jqno.equalsverifier.EqualsVerifier;
 
 public class BlobIdTest {
@@ -77,7 +77,7 @@ public class BlobIdTest {
 
     @Test
     public void forPayloadShouldHashArray() {
-        BlobId blobId = BlobId.forPayload("content".getBytes(Charsets.UTF_8));
+        BlobId blobId = BlobId.forPayload("content".getBytes(StandardCharsets.UTF_8));
 
         assertThat(blobId.getId()).isEqualTo("ed7002b439e9ac845f22357d822bac1444730fbdb6016d3ec9432297b9ec9f73");
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraBlobsDAOTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraBlobsDAOTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraBlobsDAOTest.java
index 2233bcb..9709bb4 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraBlobsDAOTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraBlobsDAOTest.java
@@ -23,6 +23,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.james.backends.cassandra.CassandraCluster;
 import org.apache.james.backends.cassandra.DockerCassandraRule;
@@ -34,7 +35,6 @@ import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Test;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Strings;
 
 public class CassandraBlobsDAOTest {
@@ -74,21 +74,21 @@ public class CassandraBlobsDAOTest {
 
         byte[] bytes = testee.read(blobId).join();
 
-        assertThat(new String(bytes, Charsets.UTF_8)).isEmpty();
+        assertThat(new String(bytes, StandardCharsets.UTF_8)).isEmpty();
     }
 
     @Test
     public void saveShouldSaveBlankData() throws Exception {
-        BlobId blobId = testee.save("".getBytes(Charsets.UTF_8)).join();
+        BlobId blobId = testee.save("".getBytes(StandardCharsets.UTF_8)).join();
 
         byte[] bytes = testee.read(blobId).join();
 
-        assertThat(new String(bytes, Charsets.UTF_8)).isEmpty();
+        assertThat(new String(bytes, StandardCharsets.UTF_8)).isEmpty();
     }
 
     @Test
     public void saveShouldReturnBlobId() throws Exception {
-        BlobId blobId = testee.save("toto".getBytes(Charsets.UTF_8)).join();
+        BlobId blobId = testee.save("toto".getBytes(StandardCharsets.UTF_8)).join();
 
         assertThat(blobId).isEqualTo(BlobId.from("31f7a65e315586ac198bd798b6629ce4903d0899476d5741a9f32e2e521b6a66"));
     }
@@ -102,31 +102,31 @@ public class CassandraBlobsDAOTest {
 
     @Test
     public void readShouldReturnSavedData() throws IOException {
-        BlobId blobId = testee.save("toto".getBytes(Charsets.UTF_8)).join();
+        BlobId blobId = testee.save("toto".getBytes(StandardCharsets.UTF_8)).join();
 
         byte[] bytes = testee.read(blobId).join();
 
-        assertThat(new String(bytes, Charsets.UTF_8)).isEqualTo("toto");
+        assertThat(new String(bytes, StandardCharsets.UTF_8)).isEqualTo("toto");
     }
 
     @Test
     public void readShouldReturnLongSavedData() throws IOException {
         String longString = Strings.repeat("0123456789\n", 1000);
-        BlobId blobId = testee.save(longString.getBytes(Charsets.UTF_8)).join();
+        BlobId blobId = testee.save(longString.getBytes(StandardCharsets.UTF_8)).join();
 
         byte[] bytes = testee.read(blobId).join();
 
-        assertThat(new String(bytes, Charsets.UTF_8)).isEqualTo(longString);
+        assertThat(new String(bytes, StandardCharsets.UTF_8)).isEqualTo(longString);
     }
 
     @Test
     public void readShouldReturnSplitSavedDataByChunk() throws IOException {
         String longString = Strings.repeat("0123456789\n", MULTIPLE_CHUNK_SIZE);
-        BlobId blobId = testee.save(longString.getBytes(Charsets.UTF_8)).join();
+        BlobId blobId = testee.save(longString.getBytes(StandardCharsets.UTF_8)).join();
 
         byte[] bytes = testee.read(blobId).join();
 
-        assertThat(new String(bytes, Charsets.UTF_8)).isEqualTo(longString);
+        assertThat(new String(bytes, StandardCharsets.UTF_8)).isEqualTo(longString);
     }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageDAOTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageDAOTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageDAOTest.java
index 2ad6928..2fa731d 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageDAOTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageDAOTest.java
@@ -58,7 +58,6 @@ import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Test;
 
-import com.google.common.base.Charsets;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.primitives.Bytes;
@@ -140,7 +139,7 @@ public class CassandraMessageDAOTest {
         MessageWithoutAttachment attachmentRepresentation =
             toMessage(testee.retrieveMessages(messageIds, MessageMapper.FetchType.Full, Limit.unlimited()));
 
-        assertThat(IOUtils.toString(attachmentRepresentation.getContent(), Charsets.UTF_8))
+        assertThat(IOUtils.toString(attachmentRepresentation.getContent(), StandardCharsets.UTF_8))
             .isEqualTo(CONTENT);
     }
 
@@ -155,9 +154,9 @@ public class CassandraMessageDAOTest {
 
         byte[] expected = Bytes.concat(
             new byte[BODY_START],
-            CONTENT.substring(BODY_START).getBytes(Charsets.UTF_8));
-        assertThat(IOUtils.toString(attachmentRepresentation.getContent(), Charsets.UTF_8))
-            .isEqualTo(IOUtils.toString(new ByteArrayInputStream(expected), Charsets.UTF_8));
+            CONTENT.substring(BODY_START).getBytes(StandardCharsets.UTF_8));
+        assertThat(IOUtils.toString(attachmentRepresentation.getContent(), StandardCharsets.UTF_8))
+            .isEqualTo(IOUtils.toString(new ByteArrayInputStream(expected), StandardCharsets.UTF_8));
     }
 
     @Test
@@ -169,7 +168,7 @@ public class CassandraMessageDAOTest {
         MessageWithoutAttachment attachmentRepresentation =
             toMessage(testee.retrieveMessages(messageIds, MessageMapper.FetchType.Headers, Limit.unlimited()));
 
-        assertThat(IOUtils.toString(attachmentRepresentation.getContent(), Charsets.UTF_8))
+        assertThat(IOUtils.toString(attachmentRepresentation.getContent(), StandardCharsets.UTF_8))
             .isEqualTo(CONTENT.substring(0, BODY_START));
     }
 
@@ -181,7 +180,7 @@ public class CassandraMessageDAOTest {
             .internalDate(new Date())
             .bodyStartOctet(bodyStart)
             .size(content.length())
-            .content(new SharedByteArrayInputStream(content.getBytes(Charsets.UTF_8)))
+            .content(new SharedByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)))
             .flags(new Flags())
             .propertyBuilder(propertyBuilder)
             .addAttachments(attachments)
@@ -344,4 +343,4 @@ public class CassandraMessageDAOTest {
         assertThatThrownBy(() -> new MessageIdAttachmentIds(messageIdFactory.generate(), null))
             .isInstanceOf(NullPointerException.class);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentMessageIdCreationTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentMessageIdCreationTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentMessageIdCreationTest.java
index 126c03a..e333368 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentMessageIdCreationTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentMessageIdCreationTest.java
@@ -57,7 +57,6 @@ import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Test;
 
-import com.google.common.base.Charsets;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 
@@ -179,7 +178,7 @@ public class AttachmentMessageIdCreationTest {
             .internalDate(new Date())
             .bodyStartOctet(BODY_START)
             .size(content.length())
-            .content(new SharedByteArrayInputStream(content.getBytes(Charsets.UTF_8)))
+            .content(new SharedByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)))
             .flags(new Flags())
             .propertyBuilder(new PropertyBuilder())
             .addAttachments(attachments)

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/utils/DataChunkerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/utils/DataChunkerTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/utils/DataChunkerTest.java
index 3d237a5..9f3d369 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/utils/DataChunkerTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/utils/DataChunkerTest.java
@@ -22,6 +22,7 @@ package org.apache.james.mailbox.cassandra.mail.utils;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.nio.ByteBuffer;
+import java.nio.charset.StandardCharsets;
 import java.util.stream.Stream;
 
 import org.apache.commons.lang3.tuple.Pair;
@@ -30,7 +31,6 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 
-import com.google.common.base.Charsets;
 import com.google.common.collect.ImmutableList;
 import com.google.common.primitives.Bytes;
 
@@ -81,7 +81,7 @@ public class DataChunkerTest {
 
     @Test
     public void chunkShouldReturnOneArrayWhenInputLessThanChunkSize() {
-        byte[] data = "12345".getBytes(Charsets.UTF_8);
+        byte[] data = "12345".getBytes(StandardCharsets.UTF_8);
 
         Stream<Pair<Integer, ByteBuffer>> chunks = testee.chunk(data, CHUNK_SIZE);
 
@@ -91,7 +91,7 @@ public class DataChunkerTest {
 
     @Test
     public void chunkShouldReturnOneArrayWhenInputEqualsChunkSize() {
-        byte[] data = "1234567890".getBytes(Charsets.UTF_8);
+        byte[] data = "1234567890".getBytes(StandardCharsets.UTF_8);
         assertThat(data.length).isEqualTo(CHUNK_SIZE);
 
         Stream<Pair<Integer, ByteBuffer>> chunks = testee.chunk(data, CHUNK_SIZE);
@@ -102,8 +102,8 @@ public class DataChunkerTest {
 
     @Test
     public void chunkShouldReturnSeveralArrayWhenInputBiggerThanChunkSize() {
-        byte[] part1 = "1234567890".getBytes(Charsets.UTF_8);
-        byte[] part2 = "12345".getBytes(Charsets.UTF_8);
+        byte[] part1 = "1234567890".getBytes(StandardCharsets.UTF_8);
+        byte[] part2 = "12345".getBytes(StandardCharsets.UTF_8);
         byte[] data = Bytes.concat(part1, part2);
 
         Stream<Pair<Integer, ByteBuffer>> chunks = testee.chunk(data, CHUNK_SIZE);

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java
----------------------------------------------------------------------
diff --git a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java
index 405f76f..94d7d11 100644
--- a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java
+++ b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java
@@ -22,6 +22,7 @@ package org.apache.james.mailbox.elasticsearch;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.ByteArrayInputStream;
+import java.nio.charset.StandardCharsets;
 import java.time.ZoneId;
 import java.util.Date;
 import java.util.concurrent.Executors;
@@ -60,7 +61,6 @@ import org.junit.Test;
 import org.junit.rules.RuleChain;
 import org.junit.rules.TemporaryFolder;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Strings;
 
 public class ElasticSearchIntegrationTest extends AbstractMessageSearchIndexTest {
@@ -147,7 +147,7 @@ public class ElasticSearchIntegrationTest extends AbstractMessageSearchIndexTest
         String recipient = "benwa@linagora.com";
         ComposedMessageId composedMessageId = messageManager.appendMessage(new ByteArrayInputStream(("To: " + recipient + "\n" +
             "\n" +
-            Strings.repeat("0à2345678é", 3200)).getBytes(Charsets.UTF_8)), new Date(), session, IS_RECENT, new Flags());
+            Strings.repeat("0à2345678é", 3200)).getBytes(StandardCharsets.UTF_8)), new Date(), session, IS_RECENT, new Flags());
 
         embeddedElasticSearch.awaitForElasticSearch();
 
@@ -164,7 +164,7 @@ public class ElasticSearchIntegrationTest extends AbstractMessageSearchIndexTest
         String recipient = "benwa@linagora.com";
         ComposedMessageId composedMessageId = messageManager.appendMessage(new ByteArrayInputStream(("To: " + recipient + "\n" +
             "\n" +
-            Strings.repeat("0123456789", 3300)).getBytes(Charsets.UTF_8)), new Date(), session, IS_RECENT, new Flags());
+            Strings.repeat("0123456789", 3300)).getBytes(StandardCharsets.UTF_8)), new Date(), session, IS_RECENT, new Flags());
 
         embeddedElasticSearch.awaitForElasticSearch();
 
@@ -181,7 +181,7 @@ public class ElasticSearchIntegrationTest extends AbstractMessageSearchIndexTest
         String recipient = "benwa@linagora.com";
         ComposedMessageId composedMessageId = messageManager.appendMessage(new ByteArrayInputStream(("To: " + recipient + "\n" +
             "\n" +
-            Strings.repeat("0123456789 ", 5000)).getBytes(Charsets.UTF_8)), new Date(), session, IS_RECENT, new Flags());
+            Strings.repeat("0123456789 ", 5000)).getBytes(StandardCharsets.UTF_8)), new Date(), session, IS_RECENT, new Flags());
 
         embeddedElasticSearch.awaitForElasticSearch();
 
@@ -198,7 +198,7 @@ public class ElasticSearchIntegrationTest extends AbstractMessageSearchIndexTest
         String recipient = "benwa@linagora.com";
         ComposedMessageId composedMessageId = messageManager.appendMessage(new ByteArrayInputStream(("To: " + recipient + "\n" +
             "\n" +
-            Strings.repeat("0123456789", 5000) + " matchMe").getBytes(Charsets.UTF_8)), new Date(), session, IS_RECENT, new Flags());
+            Strings.repeat("0123456789", 5000) + " matchMe").getBytes(StandardCharsets.UTF_8)), new Date(), session, IS_RECENT, new Flags());
 
         embeddedElasticSearch.awaitForElasticSearch();
 
@@ -216,7 +216,7 @@ public class ElasticSearchIntegrationTest extends AbstractMessageSearchIndexTest
         String reasonableLongTerm = "dichlorodiphényltrichloroéthane";
         ComposedMessageId composedMessageId = messageManager.appendMessage(new ByteArrayInputStream(("To: " + recipient + "\n" +
             "\n" +
-            reasonableLongTerm).getBytes(Charsets.UTF_8)), new Date(), session, IS_RECENT, new Flags());
+            reasonableLongTerm).getBytes(StandardCharsets.UTF_8)), new Date(), session, IS_RECENT, new Flags());
 
         embeddedElasticSearch.awaitForElasticSearch();
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJsonTest.java
----------------------------------------------------------------------
diff --git a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJsonTest.java b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJsonTest.java
index c104324..3193211 100644
--- a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJsonTest.java
+++ b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJsonTest.java
@@ -26,6 +26,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 import java.io.IOException;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.time.ZoneId;
 import java.util.Date;
 
@@ -54,7 +55,6 @@ import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Test;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Throwables;
 import com.google.common.collect.ImmutableList;
 
@@ -66,7 +66,7 @@ public class MessageToElasticSearchJsonTest {
     public static final MessageId MESSAGE_ID = TestMessageId.of(184L);
     public static final long MOD_SEQ = 42L;
     public static final MessageUid UID = MessageUid.of(25);
-    public static final Charset CHARSET = Charsets.UTF_8;
+    public static final Charset CHARSET = StandardCharsets.UTF_8;
 
     private TextExtractor textExtractor;
 
@@ -101,7 +101,7 @@ public class MessageToElasticSearchJsonTest {
                 date,
                 SIZE,
                 BODY_START_OCTET,
-                new SharedByteArrayInputStream("message".getBytes(Charsets.UTF_8)),
+                new SharedByteArrayInputStream("message".getBytes(StandardCharsets.UTF_8)),
                 new Flags(),
                 propertyBuilder,
                 MAILBOX_ID);

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/JsoupTextExtractor.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/JsoupTextExtractor.java b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/JsoupTextExtractor.java
index a7d91e4..13253e0 100644
--- a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/JsoupTextExtractor.java
+++ b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/JsoupTextExtractor.java
@@ -20,6 +20,7 @@
 package org.apache.james.mailbox.inmemory;
 
 import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
 import java.util.List;
 import java.util.Map;
 
@@ -27,7 +28,6 @@ import org.apache.commons.io.IOUtils;
 import org.apache.james.mailbox.extractor.ParsedContent;
 import org.apache.james.mailbox.extractor.TextExtractor;
 
-import com.google.common.base.Charsets;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 
@@ -42,10 +42,10 @@ public class JsoupTextExtractor implements TextExtractor {
         Map<String, List<String>> emptyMetadata = Maps.newHashMap();
         if (contentType != null) {
            if (contentType.equals("text/plain")) {
-            return new ParsedContent(IOUtils.toString(inputStream, Charsets.UTF_8), emptyMetadata);
+            return new ParsedContent(IOUtils.toString(inputStream, StandardCharsets.UTF_8), emptyMetadata);
            }
            if (contentType.equals("text/html")) {
-               Document doc = Jsoup.parse(IOUtils.toString(inputStream, Charsets.UTF_8));
+               Document doc = Jsoup.parse(IOUtils.toString(inputStream, StandardCharsets.UTF_8));
                doc.select(TITLE_HTML_TAG).remove();
                return new ParsedContent(doc.text(), emptyMetadata);
            }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMessageIdManagerTestSystem.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMessageIdManagerTestSystem.java b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMessageIdManagerTestSystem.java
index b7e7ca2..ccde587 100644
--- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMessageIdManagerTestSystem.java
+++ b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMessageIdManagerTestSystem.java
@@ -19,6 +19,7 @@
 package org.apache.james.mailbox.inmemory;
 
 import java.io.ByteArrayInputStream;
+import java.nio.charset.StandardCharsets;
 import java.util.Date;
 import java.util.Optional;
 
@@ -43,7 +44,6 @@ import org.apache.james.mailbox.store.StoreMailboxManager;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Throwables;
 
 public class InMemoryMessageIdManagerTestSystem extends MessageIdManagerTestSystem {
@@ -59,7 +59,7 @@ public class InMemoryMessageIdManagerTestSystem extends MessageIdManagerTestSyst
     private static final MessageId FIRST_MESSAGE_ID = InMemoryMessageId.of(1);
     private static final long ONE_HUNDRED = 100;
     private static final int UID_VALIDITY = 1024;
-    public static final byte[] CONTENT = "Subject: test\r\n\r\ntestmail".getBytes(Charsets.UTF_8);
+    public static final byte[] CONTENT = "Subject: test\r\n\r\ntestmail".getBytes(StandardCharsets.UTF_8);
 
     private final MailboxManager mailboxManager;
     private Optional<MessageId> lastMessageIdUsed;

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMessageManagerTestSystem.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMessageManagerTestSystem.java b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMessageManagerTestSystem.java
index 31dc491..8362fe1 100644
--- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMessageManagerTestSystem.java
+++ b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMessageManagerTestSystem.java
@@ -19,6 +19,7 @@
 package org.apache.james.mailbox.inmemory;
 
 import java.io.ByteArrayInputStream;
+import java.nio.charset.StandardCharsets;
 import java.util.Date;
 import java.util.Optional;
 
@@ -39,7 +40,6 @@ import org.apache.james.mailbox.store.MessageManagerTestSystem;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Throwables;
 
 public class InMemoryMessageManagerTestSystem extends MessageManagerTestSystem {
@@ -47,7 +47,7 @@ public class InMemoryMessageManagerTestSystem extends MessageManagerTestSystem {
     private static final MessageId FIRST_MESSAGE_ID = InMemoryMessageId.of(1);
     private static final long ONE_HUNDRED = 100;
     private static final int UID_VALIDITY = 1024;
-    public static final byte[] CONTENT = "Subject: test\r\n\r\ntestmail".getBytes(Charsets.UTF_8);
+    public static final byte[] CONTENT = "Subject: test\r\n\r\ntestmail".getBytes(StandardCharsets.UTF_8);
 
     private final MailboxManager mailboxManager;
     private Optional<MessageId> lastMessageIdUsed;

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/PDFTextExtractor.java
----------------------------------------------------------------------
diff --git a/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/PDFTextExtractor.java b/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/PDFTextExtractor.java
index 1e21b7e..0e9e6a8 100644
--- a/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/PDFTextExtractor.java
+++ b/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/PDFTextExtractor.java
@@ -20,6 +20,7 @@ package org.apache.james.mailbox.store.search;
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.james.mailbox.extractor.ParsedContent;
@@ -27,7 +28,6 @@ import org.apache.james.mailbox.extractor.TextExtractor;
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.pdfbox.text.PDFTextStripper;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
 
@@ -43,7 +43,7 @@ public class PDFTextExtractor implements TextExtractor {
         if (isPDF(contentType)) {
             return extractTextFromPDF(inputStream);
         }
-        return new ParsedContent(IOUtils.toString(inputStream, Charsets.UTF_8), ImmutableMap.of());
+        return new ParsedContent(IOUtils.toString(inputStream, StandardCharsets.UTF_8), ImmutableMap.of());
     }
 
     private boolean isPDF(String contentType) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/store/src/main/java/org/apache/james/mailbox/store/extractor/DefaultTextExtractor.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/extractor/DefaultTextExtractor.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/extractor/DefaultTextExtractor.java
index 93b9551..f6065c4 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/extractor/DefaultTextExtractor.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/extractor/DefaultTextExtractor.java
@@ -20,14 +20,13 @@
 package org.apache.james.mailbox.store.extractor;
 
 import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.james.mailbox.extractor.ParsedContent;
 import org.apache.james.mailbox.extractor.TextExtractor;
 
-import com.google.common.base.Charsets;
-
 /**
  * A default text extractor that is directly based on the input file provided.
  * 
@@ -38,7 +37,7 @@ public class DefaultTextExtractor implements TextExtractor {
     @Override
     public ParsedContent extractContent(InputStream inputStream, String contentType) throws Exception {
         if(contentType != null && contentType.startsWith("text/") ) {
-            return new ParsedContent(IOUtils.toString(inputStream, Charsets.UTF_8), new HashMap<>());
+            return new ParsedContent(IOUtils.toString(inputStream, StandardCharsets.UTF_8), new HashMap<>());
         } else {
             return new ParsedContent(null, new HashMap<>());
         }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderComplexMultipartTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderComplexMultipartTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderComplexMultipartTest.java
index ed23ca3..eaf685c 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderComplexMultipartTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderComplexMultipartTest.java
@@ -25,6 +25,7 @@ import static org.junit.Assert.fail;
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.util.List;
 
 import org.apache.commons.io.IOUtils;
@@ -34,8 +35,6 @@ import org.apache.james.mailbox.store.streaming.PartContentBuilder.PartNotFoundE
 import org.junit.Before;
 import org.junit.Test;
 
-import com.google.common.base.Charsets;
-
 public class PartContentBuilderComplexMultipartTest {
 
     private static final String PREAMBLE = "This is the preamble";
@@ -193,12 +192,12 @@ public class PartContentBuilderComplexMultipartTest {
 
     private String fullContent(int[] position) throws Exception {
         to(position);
-        return IOUtils.toString(builder.getFullContent().getInputStream(), Charsets.UTF_8);
+        return IOUtils.toString(builder.getFullContent().getInputStream(), StandardCharsets.UTF_8);
     }
 
     private String bodyContent(int[] position) throws Exception {
         to(position);
-        return IOUtils.toString(builder.getMimeBodyContent().getInputStream(), Charsets.UTF_8);
+        return IOUtils.toString(builder.getMimeBodyContent().getInputStream(), StandardCharsets.UTF_8);
     }
 
     private void checkContentType(String contentType, int[] position)

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderMultipartAlternativeTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderMultipartAlternativeTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderMultipartAlternativeTest.java
index 55d88e2..abff3b0 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderMultipartAlternativeTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderMultipartAlternativeTest.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertEquals;
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.util.List;
 
 import org.apache.commons.io.IOUtils;
@@ -32,8 +33,6 @@ import org.apache.james.mailbox.store.streaming.PartContentBuilder;
 import org.junit.Before;
 import org.junit.Test;
 
-import com.google.common.base.Charsets;
-
 public class PartContentBuilderMultipartAlternativeTest {
 
     private static final String CONTENT_TYPE_PLAIN = "text/plain;charset=us-ascii";
@@ -106,7 +105,7 @@ public class PartContentBuilderMultipartAlternativeTest {
                 .encode(mail).array());
         builder.parse(in);
         builder.to(position);
-        return IOUtils.toString(builder.getFullContent().getInputStream(), Charsets.UTF_8);
+        return IOUtils.toString(builder.getFullContent().getInputStream(), StandardCharsets.UTF_8);
     }
 
     private String bodyContent(String mail, int position) throws Exception {
@@ -114,7 +113,7 @@ public class PartContentBuilderMultipartAlternativeTest {
                 .encode(mail).array());
         builder.parse(in);
         builder.to(position);
-        return IOUtils.toString(builder.getMimeBodyContent().getInputStream(), Charsets.UTF_8);
+        return IOUtils.toString(builder.getMimeBodyContent().getInputStream(), StandardCharsets.UTF_8);
     }
 
     private void checkContentType(String contentType, String mail, int position)

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/AttachmentMapperTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/AttachmentMapperTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/AttachmentMapperTest.java
index 01514bb..03b27ce 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/AttachmentMapperTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/AttachmentMapperTest.java
@@ -21,6 +21,7 @@ package org.apache.james.mailbox.store.mail.model;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
+import java.nio.charset.StandardCharsets;
 import java.util.Collection;
 import java.util.List;
 
@@ -35,11 +36,10 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 
-import com.google.common.base.Charsets;
 import com.google.common.collect.ImmutableList;
 
 public abstract class AttachmentMapperTest {
-    private static final AttachmentId UNKNOWN_ATTACHMENT_ID = AttachmentId.forPayloadAndType("unknown".getBytes(Charsets.UTF_8), "type");
+    private static final AttachmentId UNKNOWN_ATTACHMENT_ID = AttachmentId.forPayloadAndType("unknown".getBytes(StandardCharsets.UTF_8), "type");
     public static final Username OWNER = Username.fromRawValue("owner");
     public static final Username ADDITIONAL_OWNER = Username.fromRawValue("additionalOwner");
 
@@ -74,7 +74,7 @@ public abstract class AttachmentMapperTest {
     public void getAttachmentShouldReturnTheAttachmentWhenReferenced() throws Exception {
         //Given
         Attachment expected = Attachment.builder()
-                .bytes("payload".getBytes(Charsets.UTF_8))
+                .bytes("payload".getBytes(StandardCharsets.UTF_8))
                 .type("content")
                 .build();
         AttachmentId attachmentId = expected.getAttachmentId();
@@ -89,11 +89,11 @@ public abstract class AttachmentMapperTest {
     public void getAttachmentShouldReturnTheAttachmentsWhenMultipleStored() throws Exception {
         //Given
         Attachment expected1 = Attachment.builder()
-                .bytes("payload1".getBytes(Charsets.UTF_8))
+                .bytes("payload1".getBytes(StandardCharsets.UTF_8))
                 .type("content1")
                 .build();
         Attachment expected2 = Attachment.builder()
-                .bytes("payload2".getBytes(Charsets.UTF_8))
+                .bytes("payload2".getBytes(StandardCharsets.UTF_8))
                 .type("content2")
                 .build();
         AttachmentId attachmentId1 = expected1.getAttachmentId();
@@ -124,14 +124,14 @@ public abstract class AttachmentMapperTest {
     public void getAttachmentsShouldReturnTheAttachmentsWhenSome() throws Exception {
         //Given
         Attachment expected = Attachment.builder()
-                .bytes("payload".getBytes(Charsets.UTF_8))
+                .bytes("payload".getBytes(StandardCharsets.UTF_8))
                 .type("content")
                 .build();
         AttachmentId attachmentId = expected.getAttachmentId();
         attachmentMapper.storeAttachmentForOwner(expected, OWNER);
 
         Attachment expected2 = Attachment.builder()
-                .bytes("payload2".getBytes(Charsets.UTF_8))
+                .bytes("payload2".getBytes(StandardCharsets.UTF_8))
                 .type("content")
                 .build();
         AttachmentId attachmentId2 = expected2.getAttachmentId();
@@ -154,7 +154,7 @@ public abstract class AttachmentMapperTest {
     public void getOwnerMessageIdsShouldReturnEmptyWhenStoredWithoutMessageId() throws Exception {
         //Given
         Attachment attachment = Attachment.builder()
-                .bytes("payload".getBytes(Charsets.UTF_8))
+                .bytes("payload".getBytes(StandardCharsets.UTF_8))
                 .type("content")
                 .build();
         AttachmentId attachmentId = attachment.getAttachmentId();
@@ -170,7 +170,7 @@ public abstract class AttachmentMapperTest {
     public void getOwnerMessageIdsShouldReturnMessageIdWhenStoredWithMessageId() throws Exception {
         //Given
         Attachment attachment = Attachment.builder()
-                .bytes("payload".getBytes(Charsets.UTF_8))
+                .bytes("payload".getBytes(StandardCharsets.UTF_8))
                 .type("content")
                 .build();
         AttachmentId attachmentId = attachment.getAttachmentId();
@@ -187,7 +187,7 @@ public abstract class AttachmentMapperTest {
     public void getOwnerMessageIdsShouldReturnTwoMessageIdsWhenStoredTwice() throws Exception {
         //Given
         Attachment attachment = Attachment.builder()
-                .bytes("payload".getBytes(Charsets.UTF_8))
+                .bytes("payload".getBytes(StandardCharsets.UTF_8))
                 .type("content")
                 .build();
         AttachmentId attachmentId = attachment.getAttachmentId();
@@ -206,11 +206,11 @@ public abstract class AttachmentMapperTest {
     public void getOwnerMessageIdsShouldReturnOnlyMatchingMessageId() throws Exception {
         //Given
         Attachment attachment = Attachment.builder()
-                .bytes("payload".getBytes(Charsets.UTF_8))
+                .bytes("payload".getBytes(StandardCharsets.UTF_8))
                 .type("content")
                 .build();
         Attachment otherAttachment = Attachment.builder()
-                .bytes("something different".getBytes(Charsets.UTF_8))
+                .bytes("something different".getBytes(StandardCharsets.UTF_8))
                 .type("content")
                 .build();
         AttachmentId attachmentId = attachment.getAttachmentId();
@@ -229,7 +229,7 @@ public abstract class AttachmentMapperTest {
     public void getOwnerMessageIdsShouldReturnOnlyOneMessageIdWhenStoredTwice() throws Exception {
         //Given
         Attachment attachment = Attachment.builder()
-                .bytes("payload".getBytes(Charsets.UTF_8))
+                .bytes("payload".getBytes(StandardCharsets.UTF_8))
                 .type("content")
                 .build();
         AttachmentId attachmentId = attachment.getAttachmentId();
@@ -247,11 +247,11 @@ public abstract class AttachmentMapperTest {
     public void getOwnerMessageIdsShouldReturnMessageIdForTwoAttachmentsWhenBothStoredAtTheSameTime() throws Exception {
         //Given
         Attachment attachment = Attachment.builder()
-                .bytes("payload".getBytes(Charsets.UTF_8))
+                .bytes("payload".getBytes(StandardCharsets.UTF_8))
                 .type("content")
                 .build();
         Attachment attachment2 = Attachment.builder()
-                .bytes("other payload".getBytes(Charsets.UTF_8))
+                .bytes("other payload".getBytes(StandardCharsets.UTF_8))
                 .type("content")
                 .build();
         AttachmentId attachmentId = attachment.getAttachmentId();
@@ -270,7 +270,7 @@ public abstract class AttachmentMapperTest {
     public void getOwnersShouldBeRetrievedWhenExplicitlySpecified() throws Exception {
         //Given
         Attachment attachment = Attachment.builder()
-            .bytes("payload".getBytes(Charsets.UTF_8))
+            .bytes("payload".getBytes(StandardCharsets.UTF_8))
             .type("content")
             .build();
 
@@ -288,7 +288,7 @@ public abstract class AttachmentMapperTest {
     public void getOwnersShouldReturnEmptyWhenMessageIdReferenced() throws Exception {
         //Given
         Attachment attachment = Attachment.builder()
-            .bytes("payload".getBytes(Charsets.UTF_8))
+            .bytes("payload".getBytes(StandardCharsets.UTF_8))
             .type("content")
             .build();
 
@@ -305,7 +305,7 @@ public abstract class AttachmentMapperTest {
     public void getOwnersShouldReturnAllOwners() throws Exception {
         //Given
         Attachment attachment = Attachment.builder()
-            .bytes("payload".getBytes(Charsets.UTF_8))
+            .bytes("payload".getBytes(StandardCharsets.UTF_8))
             .type("content")
             .build();
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/MessageAssert.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/MessageAssert.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/MessageAssert.java
index 67c1ba0..cd61f20 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/MessageAssert.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/MessageAssert.java
@@ -20,6 +20,7 @@
 package org.apache.james.mailbox.store.mail.model;
 
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 
 import javax.mail.Flags;
 
@@ -28,7 +29,6 @@ import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.MessageMapper.FetchType;
 import org.assertj.core.api.AbstractAssert;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Objects;
 
 public class MessageAssert extends AbstractAssert<MessageAssert, MailboxMessage> {
@@ -88,18 +88,18 @@ public class MessageAssert extends AbstractAssert<MessageAssert, MailboxMessage>
             if (!Objects.equal(actual.getFullContentOctets(), expected.getFullContentOctets())) {
                 failWithMessage("Expected MailboxMessage size to be <%s> but was <%s>", expected.getFullContentOctets(), actual.getFullContentOctets());
             }
-            if (!Objects.equal(IOUtils.toString(actual.getFullContent(), Charsets.UTF_8), IOUtils.toString(expected.getFullContent(), Charsets.UTF_8))) {
-                failWithMessage("Expected Full content to be <%s> but was <%s>", IOUtils.toString(expected.getFullContent(), Charsets.UTF_8), IOUtils.toString(actual.getFullContent(), Charsets.UTF_8));
+            if (!Objects.equal(IOUtils.toString(actual.getFullContent(), StandardCharsets.UTF_8), IOUtils.toString(expected.getFullContent(), StandardCharsets.UTF_8))) {
+                failWithMessage("Expected Full content to be <%s> but was <%s>", IOUtils.toString(expected.getFullContent(), StandardCharsets.UTF_8), IOUtils.toString(actual.getFullContent(), StandardCharsets.UTF_8));
             }
         }
         if (usedFetchType == MessageMapper.FetchType.Full || usedFetchType == MessageMapper.FetchType.Headers) {
-            if (!Objects.equal(IOUtils.toString(actual.getHeaderContent(), Charsets.UTF_8), IOUtils.toString(expected.getHeaderContent(), Charsets.UTF_8))) {
-                failWithMessage("Expected Header content to be <%s> but was <%s>", IOUtils.toString(expected.getHeaderContent(), Charsets.UTF_8), IOUtils.toString(actual.getHeaderContent(), Charsets.UTF_8));
+            if (!Objects.equal(IOUtils.toString(actual.getHeaderContent(), StandardCharsets.UTF_8), IOUtils.toString(expected.getHeaderContent(), StandardCharsets.UTF_8))) {
+                failWithMessage("Expected Header content to be <%s> but was <%s>", IOUtils.toString(expected.getHeaderContent(), StandardCharsets.UTF_8), IOUtils.toString(actual.getHeaderContent(), StandardCharsets.UTF_8));
             }
         }
         if (usedFetchType == MessageMapper.FetchType.Full || usedFetchType == MessageMapper.FetchType.Body) {
-            if (!Objects.equal(IOUtils.toString(actual.getBodyContent(), Charsets.UTF_8), IOUtils.toString(expected.getBodyContent(), Charsets.UTF_8))) {
-                failWithMessage("Expected Body content to be <%s> but was <%s>", IOUtils.toString(expected.getBodyContent(), Charsets.UTF_8), IOUtils.toString(actual.getBodyContent(), Charsets.UTF_8));
+            if (!Objects.equal(IOUtils.toString(actual.getBodyContent(), StandardCharsets.UTF_8), IOUtils.toString(expected.getBodyContent(), StandardCharsets.UTF_8))) {
+                failWithMessage("Expected Body content to be <%s> but was <%s>", IOUtils.toString(expected.getBodyContent(), StandardCharsets.UTF_8), IOUtils.toString(actual.getBodyContent(), StandardCharsets.UTF_8));
             }
         }
         return this;

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailboxMessageTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailboxMessageTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailboxMessageTest.java
index 86b6575..251b2f7 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailboxMessageTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailboxMessageTest.java
@@ -22,6 +22,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.IOException;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.util.Calendar;
 import java.util.Date;
 
@@ -44,11 +45,10 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 
-import com.google.common.base.Charsets;
 import com.google.common.collect.ImmutableList;
 
 public class SimpleMailboxMessageTest {
-    private static final Charset MESSAGE_CHARSET = Charsets.UTF_8;
+    private static final Charset MESSAGE_CHARSET = StandardCharsets.UTF_8;
     private static final String MESSAGE_CONTENT = "Simple message content without special characters";
     public static final SharedByteArrayInputStream CONTENT_STREAM = new SharedByteArrayInputStream(MESSAGE_CONTENT.getBytes(MESSAGE_CHARSET));
     private static final String MESSAGE_CONTENT_SPECIAL_CHAR = "Simple message content with special characters: \"'(§è!çà$*`";
@@ -127,8 +127,8 @@ public class SimpleMailboxMessageTest {
         assertThat(copy.getMessage())
             .isEqualToIgnoringGivenFields(original.getMessage(), "content")
             .isNotSameAs(original.getMessage());
-        assertThat(IOUtils.toString(copy.getMessage().getFullContent(), Charsets.UTF_8))
-            .isEqualTo(IOUtils.toString(original.getMessage().getFullContent(), Charsets.UTF_8));
+        assertThat(IOUtils.toString(copy.getMessage().getFullContent(), StandardCharsets.UTF_8))
+            .isEqualTo(IOUtils.toString(original.getMessage().getFullContent(), StandardCharsets.UTF_8));
         assertThat(SimpleMailboxMessage.copy(TEST_ID, original).getTextualLineCount()).isEqualTo(textualLineCount);
         assertThat(SimpleMailboxMessage.copy(TEST_ID, original).getMediaType()).isEqualTo(text);
         assertThat(SimpleMailboxMessage.copy(TEST_ID, original).getSubType()).isEqualTo(plain);
@@ -192,7 +192,7 @@ public class SimpleMailboxMessageTest {
         MessageUid uid = MessageUid.of(45);
         MessageAttachment messageAttachment = MessageAttachment.builder()
             .attachment(Attachment.builder()
-                .bytes("".getBytes(Charsets.UTF_8))
+                .bytes("".getBytes(StandardCharsets.UTF_8))
                 .type("type")
                 .build())
             .name("name")
@@ -217,7 +217,7 @@ public class SimpleMailboxMessageTest {
         soft.assertThat(message.getInternalDate()).isEqualTo(internalDate);
         soft.assertThat(message.getHeaderOctets()).isEqualTo(BODY_START_OCTET);
         soft.assertThat(message.getFullContentOctets()).isEqualTo(SIZE);
-        soft.assertThat(IOUtils.toString(message.getFullContent(), Charsets.UTF_8)).isEqualTo(MESSAGE_CONTENT);
+        soft.assertThat(IOUtils.toString(message.getFullContent(), StandardCharsets.UTF_8)).isEqualTo(MESSAGE_CONTENT);
         soft.assertThat(message.createFlags()).isEqualTo(flags);
         soft.assertThat(message.getProperties()).isEqualTo(propertyBuilder.toProperties());
         soft.assertThat(message.getUid()).isEqualTo(uid);

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/store/src/test/java/org/apache/james/mailbox/store/search/AbstractMessageSearchIndexTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/search/AbstractMessageSearchIndexTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/search/AbstractMessageSearchIndexTest.java
index ad89eac..e6e8790 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/search/AbstractMessageSearchIndexTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/search/AbstractMessageSearchIndexTest.java
@@ -24,6 +24,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import java.nio.charset.StandardCharsets;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
@@ -59,7 +60,6 @@ import org.junit.Assume;
 import org.junit.Before;
 import org.junit.Test;
 
-import com.google.common.base.Charsets;
 import com.google.common.collect.ImmutableList;
 
 public abstract class AbstractMessageSearchIndexTest {
@@ -1185,7 +1185,7 @@ public abstract class AbstractMessageSearchIndexTest {
                 .setBody(attachmentContent, "application/pdf")
                 .setContentDisposition("attachment")
                 .build();
-        BodyPart textPart = BodyPartBuilder.create().setBody("The message has a PDF attachment.", "plain", Charsets.UTF_8).build();
+        BodyPart textPart = BodyPartBuilder.create().setBody("The message has a PDF attachment.", "plain", StandardCharsets.UTF_8).build();
         Multipart multipart = MultipartBuilder.create("mixed")
                 .addBodyPart(attachment)
                 .addBodyPart(textPart)

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailbox/tika/src/test/java/org/apache/james/mailbox/tika/TikaTextExtractorTest.java
----------------------------------------------------------------------
diff --git a/mailbox/tika/src/test/java/org/apache/james/mailbox/tika/TikaTextExtractorTest.java b/mailbox/tika/src/test/java/org/apache/james/mailbox/tika/TikaTextExtractorTest.java
index 9794ead..e6d4f0d 100644
--- a/mailbox/tika/src/test/java/org/apache/james/mailbox/tika/TikaTextExtractorTest.java
+++ b/mailbox/tika/src/test/java/org/apache/james/mailbox/tika/TikaTextExtractorTest.java
@@ -25,6 +25,7 @@ import static org.mockito.Mockito.when;
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
 import java.util.List;
 
 import org.apache.commons.io.IOUtils;
@@ -39,7 +40,6 @@ import org.junit.rules.ExpectedException;
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.node.JsonNodeType;
-import com.google.common.base.Charsets;
 import com.google.common.collect.ImmutableList;
 
 public class TikaTextExtractorTest {
@@ -63,7 +63,7 @@ public class TikaTextExtractorTest {
 
     @Test
     public void textualContentShouldReturnNullWhenInputStreamIsEmpty() throws Exception {
-        assertThat(textExtractor.extractContent(IOUtils.toInputStream("", Charsets.UTF_8), "text/plain").getTextualContent())
+        assertThat(textExtractor.extractContent(IOUtils.toInputStream("", StandardCharsets.UTF_8), "text/plain").getTextualContent())
             .isEmpty();
     }
 
@@ -157,7 +157,7 @@ public class TikaTextExtractorTest {
     public void deserializerShouldNotThrowWhenMoreThanOneNode() throws Exception {
         TikaTextExtractor textExtractor = new TikaTextExtractor(
             (inputStream, contentType) -> new ByteArrayInputStream(("[{\"X-TIKA:content\": \"This is an awesome LibreOffice document !\"}, " +
-                "{\"Chroma BlackIsZero\": \"true\"}]").getBytes(Charsets.UTF_8)));
+                "{\"Chroma BlackIsZero\": \"true\"}]").getBytes(StandardCharsets.UTF_8)));
 
         InputStream inputStream = null;
         textExtractor.extractContent(inputStream, "text/plain");
@@ -168,7 +168,7 @@ public class TikaTextExtractorTest {
         String expectedExtractedContent = "content A";
         TikaTextExtractor textExtractor = new TikaTextExtractor(
             (inputStream, contentType) -> new ByteArrayInputStream(("[{\"X-TIKA:content\": \"" + expectedExtractedContent + "\"}, " +
-                "{\"X-TIKA:content\": \"content B\"}]").getBytes(Charsets.UTF_8)));
+                "{\"X-TIKA:content\": \"content B\"}]").getBytes(StandardCharsets.UTF_8)));
 
         InputStream inputStream = null;
         ParsedContent parsedContent = textExtractor.extractContent(inputStream, "text/plain");
@@ -182,7 +182,7 @@ public class TikaTextExtractorTest {
         expectedException.expectMessage("The element should be a Json object");
 
         TikaTextExtractor textExtractor = new TikaTextExtractor(
-            (inputStream, contentType) -> new ByteArrayInputStream("[\"value1\"]".getBytes(Charsets.UTF_8)));
+            (inputStream, contentType) -> new ByteArrayInputStream("[\"value1\"]".getBytes(StandardCharsets.UTF_8)));
 
         InputStream inputStream = null;
         textExtractor.extractContent(inputStream, "text/plain");

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailet/base/src/test/java/org/apache/mailet/base/test/MimeMessageBuilder.java
----------------------------------------------------------------------
diff --git a/mailet/base/src/test/java/org/apache/mailet/base/test/MimeMessageBuilder.java b/mailet/base/src/test/java/org/apache/mailet/base/test/MimeMessageBuilder.java
index 498a6ff..4c59513 100644
--- a/mailet/base/src/test/java/org/apache/mailet/base/test/MimeMessageBuilder.java
+++ b/mailet/base/src/test/java/org/apache/mailet/base/test/MimeMessageBuilder.java
@@ -22,6 +22,7 @@ package org.apache.mailet.base.test;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
@@ -45,7 +46,6 @@ import javax.mail.util.ByteArrayDataSource;
 import org.apache.commons.io.IOUtils;
 
 import com.github.steveash.guavate.Guavate;
-import com.google.common.base.Charsets;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Throwables;
 import com.google.common.collect.ImmutableList;
@@ -321,7 +321,7 @@ public class MimeMessageBuilder {
     public MimeMessageBuilder setMultipartWithSubMessage(MimeMessage mimeMessage) throws MessagingException, IOException {
         return setMultipartWithBodyParts(
             new MimeBodyPart(
-                new InternetHeaders(new ByteArrayInputStream("Content-Type: multipart/mixed".getBytes(Charsets.US_ASCII))),
+                new InternetHeaders(new ByteArrayInputStream("Content-Type: multipart/mixed".getBytes(StandardCharsets.US_ASCII))),
                 IOUtils.toByteArray(mimeMessage.getInputStream())));
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailet/crypto/src/main/java/org/apache/james/transport/mailets/SMIMEDecrypt.java
----------------------------------------------------------------------
diff --git a/mailet/crypto/src/main/java/org/apache/james/transport/mailets/SMIMEDecrypt.java b/mailet/crypto/src/main/java/org/apache/james/transport/mailets/SMIMEDecrypt.java
index d7e519c..863b76c 100644
--- a/mailet/crypto/src/main/java/org/apache/james/transport/mailets/SMIMEDecrypt.java
+++ b/mailet/crypto/src/main/java/org/apache/james/transport/mailets/SMIMEDecrypt.java
@@ -49,8 +49,6 @@ import org.bouncycastle.mail.smime.SMIMEUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Charsets;
-
 /**
  * This mailet decrypts a s/mime encrypted message. It takes as input an
  * encrypted message and it tries to dechiper it using the key specified in its
@@ -165,7 +163,7 @@ public class SMIMEDecrypt extends GenericMailet {
             // I start the message stripping.
             try {
                 MimeMessage newMessage = new MimeMessage(message);
-                newMessage.setText(text(strippedMessage), Charsets.UTF_8.name());
+                newMessage.setText(text(strippedMessage), StandardCharsets.UTF_8.name());
                 if (!strippedMessage.isMimeType("multipart/*")) {
                     newMessage.setDisposition(null);
                 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailet/icalendar/src/main/java/org/apache/james/transport/mailets/ICALToJsonAttribute.java
----------------------------------------------------------------------
diff --git a/mailet/icalendar/src/main/java/org/apache/james/transport/mailets/ICALToJsonAttribute.java b/mailet/icalendar/src/main/java/org/apache/james/transport/mailets/ICALToJsonAttribute.java
index 5fb3a94..1f64246 100644
--- a/mailet/icalendar/src/main/java/org/apache/james/transport/mailets/ICALToJsonAttribute.java
+++ b/mailet/icalendar/src/main/java/org/apache/james/transport/mailets/ICALToJsonAttribute.java
@@ -20,6 +20,7 @@
 package org.apache.james.transport.mailets;
 
 import java.io.Serializable;
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.Map;
 import java.util.Optional;
@@ -44,7 +45,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
 import com.github.fge.lambdas.Throwing;
 import com.github.steveash.guavate.Guavate;
-import com.google.common.base.Charsets;
 import com.google.common.base.Strings;
 
 import net.fortuna.ical4j.model.Calendar;
@@ -174,7 +174,7 @@ public class ICALToJsonAttribute extends GenericMailet {
             .stream()
             .flatMap(recipient -> toICAL(entry, rawCalendars, recipient, sender))
             .flatMap(ical -> toJson(ical, mail.getName()))
-            .map(json -> Pair.of(UUID.randomUUID().toString(), json.getBytes(Charsets.UTF_8)));
+            .map(json -> Pair.of(UUID.randomUUID().toString(), json.getBytes(StandardCharsets.UTF_8)));
     }
 
     private Stream<String> toJson(ICAL ical, String mailName) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailet/icalendar/src/main/java/org/apache/james/transport/mailets/model/ICAL.java
----------------------------------------------------------------------
diff --git a/mailet/icalendar/src/main/java/org/apache/james/transport/mailets/model/ICAL.java b/mailet/icalendar/src/main/java/org/apache/james/transport/mailets/model/ICAL.java
index 29dc158..7a09d65 100644
--- a/mailet/icalendar/src/main/java/org/apache/james/transport/mailets/model/ICAL.java
+++ b/mailet/icalendar/src/main/java/org/apache/james/transport/mailets/model/ICAL.java
@@ -19,13 +19,13 @@
 
 package org.apache.james.transport.mailets.model;
 
+import java.nio.charset.StandardCharsets;
 import java.util.Objects;
 import java.util.Optional;
 
 import org.apache.james.core.MailAddress;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.google.common.base.Charsets;
 import com.google.common.base.Preconditions;
 
 import net.fortuna.ical4j.model.Calendar;
@@ -47,7 +47,7 @@ public class ICAL {
         private Optional<String> recurrenceId = Optional.empty();
 
         public Builder from(Calendar calendar, byte[] originalEvent) {
-            this.ical = new String(originalEvent, Charsets.UTF_8);
+            this.ical = new String(originalEvent, StandardCharsets.UTF_8);
             VEvent vevent = (VEvent) calendar.getComponent("VEVENT");
             this.uid = optionalOf(vevent.getUid());
             this.method = optionalOf(calendar.getMethod());

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailet/icalendar/src/test/java/org/apache/james/transport/mailets/ICALToJsonAttributeTest.java
----------------------------------------------------------------------
diff --git a/mailet/icalendar/src/test/java/org/apache/james/transport/mailets/ICALToJsonAttributeTest.java b/mailet/icalendar/src/test/java/org/apache/james/transport/mailets/ICALToJsonAttributeTest.java
index 21c061e..f656c9a 100644
--- a/mailet/icalendar/src/test/java/org/apache/james/transport/mailets/ICALToJsonAttributeTest.java
+++ b/mailet/icalendar/src/test/java/org/apache/james/transport/mailets/ICALToJsonAttributeTest.java
@@ -24,6 +24,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.ByteArrayInputStream;
 import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -42,7 +43,6 @@ import org.junit.Test;
 import org.junit.rules.ExpectedException;
 
 import com.fasterxml.jackson.core.io.JsonStringEncoder;
-import com.google.common.base.Charsets;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.io.ByteStreams;
 
@@ -251,7 +251,7 @@ public class ICALToJsonAttributeTest {
 
         Map<String, byte[]> jsons = (Map<String, byte[]>) mail.getAttribute(ICALToJsonAttribute.DEFAULT_DESTINATION_ATTRIBUTE_NAME);
         assertThat(jsons).hasSize(1);
-        assertThatJson(new String(jsons.values().iterator().next(), Charsets.UTF_8))
+        assertThatJson(new String(jsons.values().iterator().next(), StandardCharsets.UTF_8))
             .isEqualTo("{" +
                 "\"ical\": \"" + toJsonValue(ics) +"\"," +
                 "\"sender\": \"" + SENDER.asString() + "\"," +
@@ -265,7 +265,7 @@ public class ICALToJsonAttributeTest {
     }
 
     private String toJsonValue(byte[] ics) throws UnsupportedEncodingException {
-        return new String(JsonStringEncoder.getInstance().quoteAsUTF8(new String(ics, Charsets.UTF_8)), Charsets.UTF_8);
+        return new String(JsonStringEncoder.getInstance().quoteAsUTF8(new String(ics, StandardCharsets.UTF_8)), StandardCharsets.UTF_8);
     }
 
     @SuppressWarnings("unchecked")
@@ -453,7 +453,7 @@ public class ICALToJsonAttributeTest {
 
         Map<String, byte[]> jsons = (Map<String, byte[]>) mail.getAttribute(ICALToJsonAttribute.DEFAULT_DESTINATION_ATTRIBUTE_NAME);
         assertThat(jsons).hasSize(1);
-        assertThatJson(new String(jsons.values().iterator().next(), Charsets.UTF_8))
+        assertThatJson(new String(jsons.values().iterator().next(), StandardCharsets.UTF_8))
             .isEqualTo("{" +
                 "\"ical\": \"" + toJsonValue(ics) +"\"," +
                 "\"sender\": \"" + from + "\"," +
@@ -488,7 +488,7 @@ public class ICALToJsonAttributeTest {
 
         Map<String, byte[]> jsons = (Map<String, byte[]>) mail.getAttribute(ICALToJsonAttribute.DEFAULT_DESTINATION_ATTRIBUTE_NAME);
         assertThat(jsons).hasSize(1);
-        assertThatJson(new String(jsons.values().iterator().next(), Charsets.UTF_8))
+        assertThatJson(new String(jsons.values().iterator().next(), StandardCharsets.UTF_8))
             .isEqualTo("{" +
                 "\"ical\": \"" + toJsonValue(ics) +"\"," +
                 "\"sender\": \"" + SENDER.asString() + "\"," +
@@ -524,7 +524,7 @@ public class ICALToJsonAttributeTest {
 
         Map<String, byte[]> jsons = (Map<String, byte[]>) mail.getAttribute(ICALToJsonAttribute.DEFAULT_DESTINATION_ATTRIBUTE_NAME);
         assertThat(jsons).hasSize(1);
-        assertThatJson(new String(jsons.values().iterator().next(), Charsets.UTF_8))
+        assertThatJson(new String(jsons.values().iterator().next(), StandardCharsets.UTF_8))
             .isEqualTo("{" +
                 "\"ical\": \"" + toJsonValue(ics) +"\"," +
                 "\"sender\": \"" + from + "\"," +
@@ -540,7 +540,7 @@ public class ICALToJsonAttributeTest {
     private List<String> toSortedValueList(Map<String, byte[]> jsons) {
         return jsons.values()
                 .stream()
-                .map(bytes -> new String(bytes, Charsets.UTF_8))
+                .map(bytes -> new String(bytes, StandardCharsets.UTF_8))
                 .sorted()
                 .collect(Collectors.toList());
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailet/standard/src/main/java/org/apache/james/transport/mailets/LogMessage.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/main/java/org/apache/james/transport/mailets/LogMessage.java b/mailet/standard/src/main/java/org/apache/james/transport/mailets/LogMessage.java
index 774817f..8f2e209 100644
--- a/mailet/standard/src/main/java/org/apache/james/transport/mailets/LogMessage.java
+++ b/mailet/standard/src/main/java/org/apache/james/transport/mailets/LogMessage.java
@@ -23,6 +23,7 @@ package org.apache.james.transport.mailets;
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
 import java.util.Collections;
 import java.util.Enumeration;
 
@@ -35,7 +36,6 @@ import org.apache.mailet.base.GenericMailet;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Charsets;
 import com.google.common.io.ByteStreams;
 
 /**
@@ -120,7 +120,7 @@ public class LogMessage extends GenericMailet {
     private void logBody(MimeMessage message) throws MessagingException, IOException {
         if (body && logger.isInfoEnabled()) {
             InputStream inputStream = ByteStreams.limit(message.getRawInputStream(), lengthToLog(message));
-            logger.info(IOUtils.toString(inputStream, Charsets.UTF_8));
+            logger.info(IOUtils.toString(inputStream, StandardCharsets.UTF_8));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailet/standard/src/main/java/org/apache/james/transport/mailets/utils/MimeMessageModifier.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/main/java/org/apache/james/transport/mailets/utils/MimeMessageModifier.java b/mailet/standard/src/main/java/org/apache/james/transport/mailets/utils/MimeMessageModifier.java
index b3c9b8d..00bad76 100644
--- a/mailet/standard/src/main/java/org/apache/james/transport/mailets/utils/MimeMessageModifier.java
+++ b/mailet/standard/src/main/java/org/apache/james/transport/mailets/utils/MimeMessageModifier.java
@@ -19,12 +19,12 @@
 
 package org.apache.james.transport.mailets.utils;
 
+import java.nio.charset.StandardCharsets;
 import java.util.Optional;
+
 import javax.mail.MessagingException;
 import javax.mail.internet.MimeMessage;
 
-import com.google.common.base.Charsets;
-
 public class MimeMessageModifier {
 
     private final MimeMessage message;
@@ -36,7 +36,7 @@ public class MimeMessageModifier {
     public void replaceSubject(Optional<String> newSubject) throws MessagingException {
         if (newSubject.isPresent()) {
             message.setSubject(null);
-            message.setSubject(newSubject.get(), Charsets.UTF_8.displayName());
+            message.setSubject(newSubject.get(), StandardCharsets.UTF_8.displayName());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailet/standard/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttributeTest.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttributeTest.java b/mailet/standard/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttributeTest.java
index 27ce10b..4859ffa 100644
--- a/mailet/standard/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttributeTest.java
+++ b/mailet/standard/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttributeTest.java
@@ -44,7 +44,6 @@ import org.junit.rules.ExpectedException;
 import org.mockito.ArgumentCaptor;
 import org.slf4j.Logger;
 
-import com.google.common.base.Charsets;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import com.rabbitmq.client.AMQP;
@@ -59,7 +58,7 @@ public class AmqpForwardAttributeTest {
     private static final String EXCHANGE_NAME = "exchangeName";
     private static final String ROUTING_KEY = "routingKey";
     private static final String AMQP_URI = "amqp://host";
-    private static final byte[] ATTACHMENT_CONTENT = "Attachment content".getBytes(Charsets.UTF_8);
+    private static final byte[] ATTACHMENT_CONTENT = "Attachment content".getBytes(StandardCharsets.UTF_8);
     private static final ImmutableMap<String, byte[]> ATTRIBUTE_CONTENT = ImmutableMap.of("attachment1.txt", ATTACHMENT_CONTENT);
 
     @Rule

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailet/standard/src/test/java/org/apache/james/transport/mailets/ContentReplacerTest.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/test/java/org/apache/james/transport/mailets/ContentReplacerTest.java b/mailet/standard/src/test/java/org/apache/james/transport/mailets/ContentReplacerTest.java
index 0ee2419..6413786 100644
--- a/mailet/standard/src/test/java/org/apache/james/transport/mailets/ContentReplacerTest.java
+++ b/mailet/standard/src/test/java/org/apache/james/transport/mailets/ContentReplacerTest.java
@@ -23,14 +23,16 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
+
+import java.nio.charset.StandardCharsets;
 import java.util.Optional;
 import java.util.regex.Pattern;
+
 import javax.mail.internet.MimeMessage;
 
 import org.apache.mailet.Mail;
 import org.junit.Test;
 
-import com.google.common.base.Charsets;
 import com.google.common.collect.ImmutableList;
 
 public class ContentReplacerTest {
@@ -86,7 +88,7 @@ public class ContentReplacerTest {
         ReplaceConfig replaceConfig = ReplaceConfig.builder()
                 .addAllBodyReplacingUnits(patterns)
                 .build();
-        testee.replaceMailContentAndSubject(mail, replaceConfig, Optional.of(Charsets.UTF_8));
+        testee.replaceMailContentAndSubject(mail, replaceConfig, Optional.of(StandardCharsets.UTF_8));
 
         verify(mimeMessage).setContent("TEST ee o", "text/plain; charset=UTF-8");
     }
@@ -110,9 +112,9 @@ public class ContentReplacerTest {
         ReplaceConfig replaceConfig = ReplaceConfig.builder()
                 .addAllSubjectReplacingUnits(patterns)
                 .build();
-        testee.replaceMailContentAndSubject(mail, replaceConfig, Optional.of(Charsets.UTF_8));
+        testee.replaceMailContentAndSubject(mail, replaceConfig, Optional.of(StandardCharsets.UTF_8));
 
-        verify(mimeMessage).setSubject("TEST ee o", Charsets.UTF_8.name());
+        verify(mimeMessage).setSubject("TEST ee o", StandardCharsets.UTF_8.name());
     }
 
     @Test
@@ -136,6 +138,6 @@ public class ContentReplacerTest {
                 .build();
         testee.replaceMailContentAndSubject(mail, replaceConfig, Optional.empty());
 
-        verify(mimeMessage).setSubject("TEST ee o", Charsets.UTF_8.name());
+        verify(mimeMessage).setSubject("TEST ee o", StandardCharsets.UTF_8.name());
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailet/standard/src/test/java/org/apache/james/transport/mailets/LogMessageTest.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/test/java/org/apache/james/transport/mailets/LogMessageTest.java b/mailet/standard/src/test/java/org/apache/james/transport/mailets/LogMessageTest.java
index 6631d40..41dc494 100644
--- a/mailet/standard/src/test/java/org/apache/james/transport/mailets/LogMessageTest.java
+++ b/mailet/standard/src/test/java/org/apache/james/transport/mailets/LogMessageTest.java
@@ -29,6 +29,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
 import static org.mockito.Mockito.when;
 
 import java.io.ByteArrayInputStream;
+import java.nio.charset.StandardCharsets;
 import java.util.Properties;
 
 import javax.mail.MessagingException;
@@ -47,8 +48,6 @@ import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.slf4j.Logger;
 
-import com.google.common.base.Charsets;
-
 public class LogMessageTest {
 
     @Rule
@@ -258,7 +257,7 @@ public class LogMessageTest {
 
     private FakeMail createMail() throws MessagingException, AddressException {
         MimeMessage message = new MimeMessage(Session.getDefaultInstance(new Properties()),
-                new ByteArrayInputStream("Subject: subject\r\nContent-Type: text/plain\r\n\r\nThis is a fake mail".getBytes(Charsets.UTF_8)));
+                new ByteArrayInputStream("Subject: subject\r\nContent-Type: text/plain\r\n\r\nThis is a fake mail".getBytes(StandardCharsets.UTF_8)));
         return FakeMail.builder()
                 .mimeMessage(message)
                 .name("name")

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailet/standard/src/test/java/org/apache/james/transport/mailets/MimeDecodingMailetTest.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/test/java/org/apache/james/transport/mailets/MimeDecodingMailetTest.java b/mailet/standard/src/test/java/org/apache/james/transport/mailets/MimeDecodingMailetTest.java
index c540f44..c8d1a7e 100644
--- a/mailet/standard/src/test/java/org/apache/james/transport/mailets/MimeDecodingMailetTest.java
+++ b/mailet/standard/src/test/java/org/apache/james/transport/mailets/MimeDecodingMailetTest.java
@@ -21,6 +21,7 @@ package org.apache.james.transport.mailets;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 
+import java.nio.charset.StandardCharsets;
 import java.util.Map;
 
 import javax.mail.MessagingException;
@@ -37,7 +38,6 @@ import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.slf4j.Logger;
 
-import com.google.common.base.Charsets;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 
@@ -143,9 +143,9 @@ public class MimeDecodingMailetTest {
                 + "Content-Type: application/octet-stream; charset=utf-8\r\n\r\n"
                 + text;
         String expectedKey = "mimePart1";
-        mail.setAttribute(MAIL_ATTRIBUTE, ImmutableMap.of(expectedKey, content.getBytes(Charsets.UTF_8)));
+        mail.setAttribute(MAIL_ATTRIBUTE, ImmutableMap.of(expectedKey, content.getBytes(StandardCharsets.UTF_8)));
 
-        byte[] expectedValue = text.getBytes(Charsets.UTF_8);
+        byte[] expectedValue = text.getBytes(StandardCharsets.UTF_8);
         testee.service(mail);
 
         Map<String, byte[]> processedAttribute = (Map<String, byte[]>) mail.getAttribute(MAIL_ATTRIBUTE);

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailet/standard/src/test/java/org/apache/james/transport/mailets/ReplaceContentTest.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/test/java/org/apache/james/transport/mailets/ReplaceContentTest.java b/mailet/standard/src/test/java/org/apache/james/transport/mailets/ReplaceContentTest.java
index 42d7cce..62723e8 100644
--- a/mailet/standard/src/test/java/org/apache/james/transport/mailets/ReplaceContentTest.java
+++ b/mailet/standard/src/test/java/org/apache/james/transport/mailets/ReplaceContentTest.java
@@ -22,6 +22,7 @@ package org.apache.james.transport.mailets;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.ByteArrayInputStream;
+import java.nio.charset.StandardCharsets;
 import java.util.Properties;
 
 import javax.mail.Session;
@@ -35,8 +36,6 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 
-import com.google.common.base.Charsets;
-
 public class ReplaceContentTest {
 
     @Rule
@@ -216,7 +215,7 @@ public class ReplaceContentTest {
         FakeMailetConfig mailetConfig = FakeMailetConfig.builder()
                 .mailetName("Test")
                 .setProperty("subjectPattern", "/test/TEST/i/,/o/a//,/s/s/i/")
-                .setProperty("charset", Charsets.UTF_8.name())
+                .setProperty("charset", StandardCharsets.UTF_8.name())
                 .build();
         mailet.init(mailetConfig);
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ba1dd277/mailet/standard/src/test/java/org/apache/james/transport/mailets/StripAttachmentTest.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/test/java/org/apache/james/transport/mailets/StripAttachmentTest.java b/mailet/standard/src/test/java/org/apache/james/transport/mailets/StripAttachmentTest.java
index 02a8e0a..a731a86 100644
--- a/mailet/standard/src/test/java/org/apache/james/transport/mailets/StripAttachmentTest.java
+++ b/mailet/standard/src/test/java/org/apache/james/transport/mailets/StripAttachmentTest.java
@@ -22,13 +22,16 @@ package org.apache.james.transport.mailets;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
+
 import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
+
 import javax.mail.BodyPart;
 import javax.mail.MessagingException;
 import javax.mail.Part;
@@ -51,8 +54,6 @@ import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.junit.rules.TemporaryFolder;
 
-import com.google.common.base.Charsets;
-
 public class StripAttachmentTest {
 
     private static final String EXPECTED_ATTACHMENT_CONTENT = "\u0023\u00A4\u00E3\u00E0\u00E9";
@@ -308,7 +309,7 @@ public class StripAttachmentTest {
         assertThat(saved).hasSize(1);
         assertThat(saved).containsKey(expectedKey);
         MimeBodyPart savedBodyPart = new MimeBodyPart(new ByteArrayInputStream(saved.get(expectedKey)));
-        String content = IOUtils.toString(savedBodyPart.getInputStream(), Charsets.UTF_8);
+        String content = IOUtils.toString(savedBodyPart.getInputStream(), StandardCharsets.UTF_8);
         assertThat(content).isEqualTo(EXPECTED_ATTACHMENT_CONTENT);
     }
 
@@ -344,7 +345,7 @@ public class StripAttachmentTest {
         assertThat(saved).hasSize(1);
         assertThat(saved).containsKey(expectedKey);
         MimeBodyPart savedBodyPart = new MimeBodyPart(new ByteArrayInputStream(saved.get(expectedKey)));
-        String content = IOUtils.toString(savedBodyPart.getInputStream(), Charsets.UTF_8);
+        String content = IOUtils.toString(savedBodyPart.getInputStream(), StandardCharsets.UTF_8);
         assertThat(content).isEqualTo(EXPECTED_ATTACHMENT_CONTENT);
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message