james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [james-project] 01/05: JAMES-2694 add zip entry type extra field
Date Mon, 15 Apr 2019 07:42:18 GMT
This is an automated email from the ASF dual-hosted git repository.

aduprat pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 91ed0d342a8c2b317053eb624b71aa74ebfc5100
Author: RĂ©mi Kowalski <rkowalski@linagora.com>
AuthorDate: Mon Mar 25 09:31:01 2019 +0100

    JAMES-2694 add zip entry type extra field
---
 .../EntryTypeExtraField.java}                      |  27 +++--
 .../mailbox/backup/{ => zip}/FlagsExtraField.java  |   2 +-
 .../backup/{ => zip}/InternalDateExtraField.java   |   2 +-
 .../mailbox/backup/{ => zip}/LongExtraField.java   |  14 +--
 .../backup/{ => zip}/MailboxIdExtraField.java      |   2 +-
 .../backup/{ => zip}/MessageIdExtraField.java      |   2 +-
 .../mailbox/backup/{ => zip}/SizeExtraField.java   |   2 +-
 .../mailbox/backup/{ => zip}/StringExtraField.java |   2 +-
 .../mailbox/backup/{ => zip}/UidExtraField.java    |   2 +-
 .../backup/{ => zip}/UidValidityExtraField.java    |   2 +-
 .../mailbox/backup/{ => zip}/WithZipHeader.java    |   2 +-
 .../{UidExtraField.java => zip/ZipEntryType.java}  |  37 +++---
 .../james/mailbox/backup/{ => zip}/Zipper.java     |  16 ++-
 .../mailbox/backup/DefaultMailboxBackupTest.java   |   1 +
 .../james/mailbox/backup/FlagExtraFieldTest.java   |   1 +
 .../mailbox/backup/InternalDateExtraFieldTest.java |   1 +
 .../mailbox/backup/MailboxIdExtraFieldTest.java    |   1 +
 .../mailbox/backup/MessageIdExtraFieldTest.java    |   1 +
 .../james/mailbox/backup/SizeExtraFieldTest.java   |   1 +
 .../james/mailbox/backup/UidExtraFieldTest.java    |   1 +
 .../mailbox/backup/UidValidityExtraFieldTest.java  |   1 +
 .../james/mailbox/backup/WithZipHeaderTest.java    |   1 +
 .../org/apache/james/mailbox/backup/ZipAssert.java |   1 +
 .../apache/james/mailbox/backup/ZipAssertTest.java |   2 +
 ...ipHeaderTest.java => ZipEntryTypeContract.java} |  27 +++--
 ...ldTest.java => ZipEntryTypeExtraFieldTest.java} | 130 ++++++++-------------
 .../apache/james/mailbox/backup/ZipperTest.java    |   8 ++
 .../apache/james/vault/DeletedMessageZipper.java   |   4 +-
 .../james/vault/DeletedMessageZipperTest.java      |   4 +-
 29 files changed, 159 insertions(+), 138 deletions(-)

diff --git a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/SizeExtraField.java
b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/EntryTypeExtraField.java
similarity index 56%
copy from mailbox/backup/src/main/java/org/apache/james/mailbox/backup/SizeExtraField.java
copy to mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/EntryTypeExtraField.java
index 4ff486b..270f983 100644
--- a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/SizeExtraField.java
+++ b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/EntryTypeExtraField.java
@@ -16,30 +16,39 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.mailbox.backup;
+package org.apache.james.mailbox.backup.zip;
 
 import java.util.Optional;
 
 import org.apache.commons.compress.archivers.zip.ZipShort;
 
-public class SizeExtraField extends LongExtraField implements WithZipHeader {
+public class EntryTypeExtraField extends LongExtraField implements WithZipHeader {
 
-    public static final ZipShort ID_AJ = new ZipShort(WithZipHeader.toLittleEndian('a', 'j'));
+    public static final ZipShort ID_AQ = new ZipShort(WithZipHeader.toLittleEndian('a', 'q'));
+    public static final EntryTypeExtraField TYPE_MAILBOX = new EntryTypeExtraField(ZipEntryType.MAILBOX);
+    public static final EntryTypeExtraField TYPE_MAILBOX_ANNOTATION_DIR = new EntryTypeExtraField(ZipEntryType.MAILBOX_ANNOTATION_DIR);
+    public static final EntryTypeExtraField TYPE_MAILBOX_ANNOTATION = new EntryTypeExtraField(ZipEntryType.MAILBOX_ANNOTATION);
+    public static final EntryTypeExtraField TYPE_MESSAGE = new EntryTypeExtraField(ZipEntryType.MESSAGE);
 
-    public SizeExtraField() {
+    /**
+     * Only for ExtraFieldUtils.register
+     */
+    public EntryTypeExtraField() {
         super();
     }
 
-    public SizeExtraField(long value) {
-        super(value);
+    public EntryTypeExtraField(ZipEntryType entryType) {
+        super(entryType.ordinal());
     }
 
-    public SizeExtraField(Optional<Long> value) {
-        super(value);
+    public Optional<ZipEntryType> getEnumValue() {
+        return getValue()
+            .map(Long::intValue)
+            .flatMap(ZipEntryType::zipEntryType);
     }
 
     @Override
     public ZipShort getHeaderId() {
-        return ID_AJ;
+        return ID_AQ;
     }
 }
diff --git a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/FlagsExtraField.java
b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/FlagsExtraField.java
similarity index 98%
rename from mailbox/backup/src/main/java/org/apache/james/mailbox/backup/FlagsExtraField.java
rename to mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/FlagsExtraField.java
index 3d7f7b3..e8e67e4 100644
--- a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/FlagsExtraField.java
+++ b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/FlagsExtraField.java
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.backup;
+package org.apache.james.mailbox.backup.zip;
 
 import java.util.Optional;
 import java.util.stream.Collectors;
diff --git a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/InternalDateExtraField.java
b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/InternalDateExtraField.java
similarity index 97%
rename from mailbox/backup/src/main/java/org/apache/james/mailbox/backup/InternalDateExtraField.java
rename to mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/InternalDateExtraField.java
index 0774647..deda4c0 100644
--- a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/InternalDateExtraField.java
+++ b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/InternalDateExtraField.java
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.backup;
+package org.apache.james.mailbox.backup.zip;
 
 import java.util.Date;
 import java.util.Optional;
diff --git a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/LongExtraField.java
b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/LongExtraField.java
similarity index 92%
rename from mailbox/backup/src/main/java/org/apache/james/mailbox/backup/LongExtraField.java
rename to mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/LongExtraField.java
index 8c0d5cf..604bc04 100644
--- a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/LongExtraField.java
+++ b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/LongExtraField.java
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.backup;
+package org.apache.james.mailbox.backup.zip;
 
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
@@ -32,15 +32,15 @@ public abstract class LongExtraField implements ZipExtraField {
 
     private Optional<Long> value;
 
-    public LongExtraField() {
+    LongExtraField() {
         this(Optional.empty());
     }
 
-    public LongExtraField(long value) {
+    LongExtraField(long value) {
         this(Optional.of(value));
     }
 
-    public LongExtraField(Optional<Long> value) {
+    LongExtraField(Optional<Long> value) {
         this.value = value;
     }
 
@@ -74,9 +74,9 @@ public abstract class LongExtraField implements ZipExtraField {
             throw new ZipException("Unexpected data length for ExtraField. Expected " + Long.BYTES
+ " but got " + length + ".");
         }
         value = Optional.of(ByteBuffer
-                .wrap(buffer, offset, Long.BYTES)
-                .order(ByteOrder.LITTLE_ENDIAN)
-                .getLong());
+            .wrap(buffer, offset, Long.BYTES)
+            .order(ByteOrder.LITTLE_ENDIAN)
+            .getLong());
     }
 
     @Override
diff --git a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/MailboxIdExtraField.java
b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/MailboxIdExtraField.java
similarity index 97%
rename from mailbox/backup/src/main/java/org/apache/james/mailbox/backup/MailboxIdExtraField.java
rename to mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/MailboxIdExtraField.java
index 5ca19db..851dcbf 100644
--- a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/MailboxIdExtraField.java
+++ b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/MailboxIdExtraField.java
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.backup;
+package org.apache.james.mailbox.backup.zip;
 
 import java.util.Optional;
 
diff --git a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/MessageIdExtraField.java
b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/MessageIdExtraField.java
similarity index 97%
rename from mailbox/backup/src/main/java/org/apache/james/mailbox/backup/MessageIdExtraField.java
rename to mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/MessageIdExtraField.java
index 46a971b..1d13eb2 100644
--- a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/MessageIdExtraField.java
+++ b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/MessageIdExtraField.java
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.backup;
+package org.apache.james.mailbox.backup.zip;
 
 import java.util.Optional;
 
diff --git a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/SizeExtraField.java
b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/SizeExtraField.java
similarity index 97%
rename from mailbox/backup/src/main/java/org/apache/james/mailbox/backup/SizeExtraField.java
rename to mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/SizeExtraField.java
index 4ff486b..a352782 100644
--- a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/SizeExtraField.java
+++ b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/SizeExtraField.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.mailbox.backup;
+package org.apache.james.mailbox.backup.zip;
 
 import java.util.Optional;
 
diff --git a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/StringExtraField.java
b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/StringExtraField.java
similarity index 98%
rename from mailbox/backup/src/main/java/org/apache/james/mailbox/backup/StringExtraField.java
rename to mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/StringExtraField.java
index 34c016d..15f8a0a 100644
--- a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/StringExtraField.java
+++ b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/StringExtraField.java
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.backup;
+package org.apache.james.mailbox.backup.zip;
 
 import java.nio.charset.StandardCharsets;
 import java.util.Objects;
diff --git a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/UidExtraField.java
b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/UidExtraField.java
similarity index 97%
copy from mailbox/backup/src/main/java/org/apache/james/mailbox/backup/UidExtraField.java
copy to mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/UidExtraField.java
index 6d2ad35..bf425b2 100644
--- a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/UidExtraField.java
+++ b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/UidExtraField.java
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.backup;
+package org.apache.james.mailbox.backup.zip;
 
 import java.util.Optional;
 
diff --git a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/UidValidityExtraField.java
b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/UidValidityExtraField.java
similarity index 97%
rename from mailbox/backup/src/main/java/org/apache/james/mailbox/backup/UidValidityExtraField.java
rename to mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/UidValidityExtraField.java
index 0fb9d23..957ac52 100644
--- a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/UidValidityExtraField.java
+++ b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/UidValidityExtraField.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.mailbox.backup;
+package org.apache.james.mailbox.backup.zip;
 
 import java.util.Optional;
 
diff --git a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/WithZipHeader.java
b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/WithZipHeader.java
similarity index 97%
rename from mailbox/backup/src/main/java/org/apache/james/mailbox/backup/WithZipHeader.java
rename to mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/WithZipHeader.java
index 873142f..6218772 100644
--- a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/WithZipHeader.java
+++ b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/WithZipHeader.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.mailbox.backup;
+package org.apache.james.mailbox.backup.zip;
 
 import java.nio.ByteOrder;
 import java.nio.CharBuffer;
diff --git a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/UidExtraField.java
b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/ZipEntryType.java
similarity index 57%
rename from mailbox/backup/src/main/java/org/apache/james/mailbox/backup/UidExtraField.java
rename to mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/ZipEntryType.java
index 6d2ad35..600260b 100644
--- a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/UidExtraField.java
+++ b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/ZipEntryType.java
@@ -16,31 +16,36 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
+package org.apache.james.mailbox.backup.zip;
 
-package org.apache.james.mailbox.backup;
-
+import java.util.Arrays;
+import java.util.Map;
 import java.util.Optional;
+import java.util.stream.IntStream;
+import java.util.stream.Stream;
 
-import org.apache.commons.compress.archivers.zip.ZipShort;
+import org.apache.commons.lang3.tuple.ImmutablePair;
 
-public class UidExtraField extends LongExtraField implements WithZipHeader {
+import com.github.steveash.guavate.Guavate;
+import com.google.common.collect.Streams;
 
-    public static final ZipShort ID_AK = new ZipShort(WithZipHeader.toLittleEndian('a', 'k'));
+public enum ZipEntryType {
+    MAILBOX,
+    MAILBOX_ANNOTATION_DIR,
+    MAILBOX_ANNOTATION,
+    MESSAGE;
 
-    public UidExtraField() {
-        super();
-    }
+    private static final Map<Integer, ZipEntryType> entryByOrdinal;
 
-    public UidExtraField(long value) {
-        super(value);
-    }
+    static {
+        Stream<ZipEntryType> valuesAsStream = Arrays.stream(values());
+        Stream<Integer> indices = IntStream.range(0, values().length).boxed();
 
-    public UidExtraField(Optional<Long> value) {
-        super(value);
+        entryByOrdinal = Streams.zip(indices, valuesAsStream, ImmutablePair::of)
+            .collect(Guavate.entriesToImmutableMap());
     }
 
-    @Override
-    public ZipShort getHeaderId() {
-        return ID_AK;
+    public static Optional<ZipEntryType> zipEntryType(int ordinal) {
+        return Optional.ofNullable(entryByOrdinal.get(ordinal));
     }
 }
diff --git a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/Zipper.java b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/Zipper.java
similarity index 90%
rename from mailbox/backup/src/main/java/org/apache/james/mailbox/backup/Zipper.java
rename to mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/Zipper.java
index c770fb8..b0d2e63 100644
--- a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/Zipper.java
+++ b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/zip/Zipper.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.mailbox.backup;
+package org.apache.james.mailbox.backup.zip;
 
 import java.io.File;
 import java.io.IOException;
@@ -31,6 +31,9 @@ import org.apache.commons.compress.archivers.zip.ExtraFieldUtils;
 import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
 import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
 import org.apache.commons.io.IOUtils;
+import org.apache.james.mailbox.backup.ArchiveService;
+import org.apache.james.mailbox.backup.Directory;
+import org.apache.james.mailbox.backup.MailboxWithAnnotations;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.model.Content;
 import org.apache.james.mailbox.model.Mailbox;
@@ -56,6 +59,7 @@ public class Zipper implements ArchiveService {
         ExtraFieldUtils.register(InternalDateExtraField.class);
         ExtraFieldUtils.register(UidValidityExtraField.class);
         ExtraFieldUtils.register(FlagsExtraField.class);
+        ExtraFieldUtils.register(EntryTypeExtraField.class);
     }
 
     @Override
@@ -75,7 +79,7 @@ public class Zipper implements ArchiveService {
 
     private void storeMessages(Stream<MessageResult> messages, ZipArchiveOutputStream
archiveOutputStream) throws IOException {
         messages.forEach(Throwing.<MessageResult>consumer(message ->
-                storeInArchive(message, archiveOutputStream)
+            storeInArchive(message, archiveOutputStream)
         ).sneakyThrow());
     }
 
@@ -86,6 +90,7 @@ public class Zipper implements ArchiveService {
         String name = mailbox.getName();
         ZipArchiveEntry archiveEntry = (ZipArchiveEntry) archiveOutputStream.createArchiveEntry(new
Directory(name), name);
 
+        archiveEntry.addExtraField(EntryTypeExtraField.TYPE_MAILBOX);
         archiveEntry.addExtraField(new MailboxIdExtraField(mailbox.getMailboxId().serialize()));
         archiveEntry.addExtraField(new UidValidityExtraField(mailbox.getUidValidity()));
 
@@ -100,6 +105,7 @@ public class Zipper implements ArchiveService {
             String annotationsDirectoryPath = name + "/" + ANNOTATION_DIRECTORY;
             ZipArchiveEntry annotationDirectory = (ZipArchiveEntry) archiveOutputStream.createArchiveEntry(
                 new Directory(annotationsDirectoryPath), annotationsDirectoryPath);
+            annotationDirectory.addExtraField(EntryTypeExtraField.TYPE_MAILBOX_ANNOTATION_DIR);
             archiveOutputStream.putArchiveEntry(annotationDirectory);
             archiveOutputStream.closeArchiveEntry();
             annotations.forEach(Throwing.consumer(annotation ->
@@ -110,6 +116,7 @@ public class Zipper implements ArchiveService {
     private void storeInArchive(MailboxAnnotation annotation, String directory, ZipArchiveOutputStream
archiveOutputStream) throws IOException {
         String entryId = directory + "/" + annotation.getKey().asString();
         ZipArchiveEntry archiveEntry = (ZipArchiveEntry) archiveOutputStream.createArchiveEntry(new
File(entryId), entryId);
+        archiveEntry.addExtraField(EntryTypeExtraField.TYPE_MAILBOX_ANNOTATION);
         archiveOutputStream.putArchiveEntry(archiveEntry);
 
         annotation.getValue().ifPresent(value -> {
@@ -127,12 +134,12 @@ public class Zipper implements ArchiveService {
 
         archiveOutputStream.putArchiveEntry(archiveEntry);
         try {
-            Content  content = message.getFullContent();
+            Content content = message.getFullContent();
             try (InputStream stream = content.getInputStream()) {
                 IOUtils.copy(stream, archiveOutputStream);
             }
         } catch (MailboxException e) {
-           LOGGER.error("Error while storing message in archive", e);
+            LOGGER.error("Error while storing message in archive", e);
         }
 
         archiveOutputStream.closeArchiveEntry();
@@ -141,6 +148,7 @@ public class Zipper implements ArchiveService {
     private ZipArchiveEntry createMessageZipArchiveEntry(MessageResult message, ZipArchiveOutputStream
archiveOutputStream, String entryId) throws IOException {
         ZipArchiveEntry archiveEntry = (ZipArchiveEntry) archiveOutputStream.createArchiveEntry(new
File(entryId), entryId);
 
+        archiveEntry.addExtraField(EntryTypeExtraField.TYPE_MESSAGE);
         archiveEntry.addExtraField(new SizeExtraField(message.getSize()));
         archiveEntry.addExtraField(new UidExtraField(message.getUid().asLong()));
         archiveEntry.addExtraField(new MessageIdExtraField(message.getMessageId().serialize()));
diff --git a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/DefaultMailboxBackupTest.java
b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/DefaultMailboxBackupTest.java
index f31c989..964e00b 100644
--- a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/DefaultMailboxBackupTest.java
+++ b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/DefaultMailboxBackupTest.java
@@ -29,6 +29,7 @@ import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.MessageManager;
 import org.apache.james.mailbox.backup.ZipAssert.EntryChecks;
+import org.apache.james.mailbox.backup.zip.Zipper;
 import org.apache.james.mailbox.extension.PreDeletionHook;
 import org.apache.james.mailbox.inmemory.MemoryMailboxManagerProvider;
 import org.apache.james.mailbox.model.MailboxId;
diff --git a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/FlagExtraFieldTest.java
b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/FlagExtraFieldTest.java
index 2210438..9b88762 100644
--- a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/FlagExtraFieldTest.java
+++ b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/FlagExtraFieldTest.java
@@ -28,6 +28,7 @@ import java.nio.charset.StandardCharsets;
 
 import javax.mail.Flags;
 
+import org.apache.james.mailbox.backup.zip.FlagsExtraField;
 import org.junit.jupiter.api.Nested;
 import org.junit.jupiter.api.Test;
 
diff --git a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/InternalDateExtraFieldTest.java
b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/InternalDateExtraFieldTest.java
index 62cb26b..c46aaeb 100644
--- a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/InternalDateExtraFieldTest.java
+++ b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/InternalDateExtraFieldTest.java
@@ -27,6 +27,7 @@ import java.nio.ByteOrder;
 import java.util.Date;
 import java.util.zip.ZipException;
 
+import org.apache.james.mailbox.backup.zip.InternalDateExtraField;
 import org.junit.jupiter.api.Nested;
 import org.junit.jupiter.api.Test;
 
diff --git a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/MailboxIdExtraFieldTest.java
b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/MailboxIdExtraFieldTest.java
index b5a95b7..160c356 100644
--- a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/MailboxIdExtraFieldTest.java
+++ b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/MailboxIdExtraFieldTest.java
@@ -26,6 +26,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
+import org.apache.james.mailbox.backup.zip.MailboxIdExtraField;
 import org.junit.jupiter.api.Nested;
 import org.junit.jupiter.api.Test;
 
diff --git a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/MessageIdExtraFieldTest.java
b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/MessageIdExtraFieldTest.java
index 16079aa..758dff6 100644
--- a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/MessageIdExtraFieldTest.java
+++ b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/MessageIdExtraFieldTest.java
@@ -26,6 +26,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
+import org.apache.james.mailbox.backup.zip.MessageIdExtraField;
 import org.junit.jupiter.api.Nested;
 import org.junit.jupiter.api.Test;
 
diff --git a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/SizeExtraFieldTest.java
b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/SizeExtraFieldTest.java
index c05ec09..0062183 100644
--- a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/SizeExtraFieldTest.java
+++ b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/SizeExtraFieldTest.java
@@ -25,6 +25,7 @@ import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 import java.util.zip.ZipException;
 
+import org.apache.james.mailbox.backup.zip.SizeExtraField;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
diff --git a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/UidExtraFieldTest.java
b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/UidExtraFieldTest.java
index 8067ee8..646c711 100644
--- a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/UidExtraFieldTest.java
+++ b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/UidExtraFieldTest.java
@@ -26,6 +26,7 @@ import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 import java.util.zip.ZipException;
 
+import org.apache.james.mailbox.backup.zip.UidExtraField;
 import org.junit.jupiter.api.Nested;
 import org.junit.jupiter.api.Test;
 
diff --git a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/UidValidityExtraFieldTest.java
b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/UidValidityExtraFieldTest.java
index 2ba8aed..60d3c58 100644
--- a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/UidValidityExtraFieldTest.java
+++ b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/UidValidityExtraFieldTest.java
@@ -26,6 +26,7 @@ import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 import java.util.zip.ZipException;
 
+import org.apache.james.mailbox.backup.zip.UidValidityExtraField;
 import org.junit.jupiter.api.Nested;
 import org.junit.jupiter.api.Test;
 
diff --git a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/WithZipHeaderTest.java
b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/WithZipHeaderTest.java
index 9a9552c..383a5aa 100644
--- a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/WithZipHeaderTest.java
+++ b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/WithZipHeaderTest.java
@@ -20,6 +20,7 @@ package org.apache.james.mailbox.backup;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
+import org.apache.james.mailbox.backup.zip.WithZipHeader;
 import org.junit.jupiter.api.Test;
 
 class WithZipHeaderTest {
diff --git a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/ZipAssert.java b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/ZipAssert.java
index 17eb3d7..e2842b8 100644
--- a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/ZipAssert.java
+++ b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/ZipAssert.java
@@ -39,6 +39,7 @@ import org.apache.commons.compress.archivers.zip.ZipExtraField;
 import org.apache.commons.compress.archivers.zip.ZipFile;
 import org.apache.commons.compress.utils.SeekableInMemoryByteChannel;
 import org.apache.commons.io.IOUtils;
+import org.apache.james.mailbox.backup.zip.WithZipHeader;
 import org.assertj.core.api.AbstractAssert;
 import org.assertj.core.error.BasicErrorMessageFactory;
 import org.assertj.core.error.ErrorMessageFactory;
diff --git a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/ZipAssertTest.java
b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/ZipAssertTest.java
index 90eb97b..adbd78e 100644
--- a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/ZipAssertTest.java
+++ b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/ZipAssertTest.java
@@ -39,6 +39,8 @@ import org.apache.commons.compress.archivers.zip.ZipExtraField;
 import org.apache.commons.compress.archivers.zip.ZipFile;
 import org.apache.commons.io.IOUtils;
 import org.apache.james.junit.TemporaryFolderExtension;
+import org.apache.james.mailbox.backup.zip.SizeExtraField;
+import org.apache.james.mailbox.backup.zip.UidExtraField;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Nested;
 import org.junit.jupiter.api.Test;
diff --git a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/WithZipHeaderTest.java
b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/ZipEntryTypeContract.java
similarity index 61%
copy from mailbox/backup/src/test/java/org/apache/james/mailbox/backup/WithZipHeaderTest.java
copy to mailbox/backup/src/test/java/org/apache/james/mailbox/backup/ZipEntryTypeContract.java
index 9a9552c..72eae0d 100644
--- a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/WithZipHeaderTest.java
+++ b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/ZipEntryTypeContract.java
@@ -20,19 +20,32 @@ package org.apache.james.mailbox.backup;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
+import org.apache.james.mailbox.backup.zip.ZipEntryType;
 import org.junit.jupiter.api.Test;
 
-class WithZipHeaderTest {
-    private static final short al = 0x6C61;
-    private static final short aq = 0x7161;
+class ZipEntryTypeContract {
+
+    private void assertZipEntryTypeDeserializedFromValue(int value, ZipEntryType expectedType)
{
+        assertThat(ZipEntryType.zipEntryType( value)).contains(expectedType);
+    }
+
+    @Test
+    void mailboxShouldBeDeserializedFromOne() {
+        assertZipEntryTypeDeserializedFromValue(0, ZipEntryType.MAILBOX);
+    }
+
+    @Test
+    void mailboxAnnotationDirShouldBeDeserializedFromTwo() {
+        assertZipEntryTypeDeserializedFromValue(1, ZipEntryType.MAILBOX_ANNOTATION_DIR);
+    }
 
     @Test
-    void toLittleEndianShouldReturnLittleEndianRepresentationOfStringAl() {
-        assertThat(WithZipHeader.toLittleEndian('a', 'l')).isEqualTo(al);
+    void mailboxAnnotationShouldBeDeserializedFromThree() {
+        assertZipEntryTypeDeserializedFromValue(2, ZipEntryType.MAILBOX_ANNOTATION);
     }
 
     @Test
-    void toLittleEndianShouldReturnLittleEndianRepresentationOfStringAq() {
-        assertThat(WithZipHeader.toLittleEndian('a', 'q')).isEqualTo(aq);
+    void messageShouldBeDeserializedFromFour() {
+        assertZipEntryTypeDeserializedFromValue(3, ZipEntryType.MESSAGE);
     }
 }
diff --git a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/SizeExtraFieldTest.java
b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/ZipEntryTypeExtraFieldTest.java
similarity index 51%
copy from mailbox/backup/src/test/java/org/apache/james/mailbox/backup/SizeExtraFieldTest.java
copy to mailbox/backup/src/test/java/org/apache/james/mailbox/backup/ZipEntryTypeExtraFieldTest.java
index c05ec09..87d886f 100644
--- a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/SizeExtraFieldTest.java
+++ b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/ZipEntryTypeExtraFieldTest.java
@@ -23,32 +23,35 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
+import java.util.Optional;
 import java.util.zip.ZipException;
 
+import org.apache.james.mailbox.backup.zip.EntryTypeExtraField;
+import org.apache.james.mailbox.backup.zip.ZipEntryType;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
 import com.google.common.base.Charsets;
-import com.google.common.primitives.Bytes;
 import nl.jqno.equalsverifier.EqualsVerifier;
 import nl.jqno.equalsverifier.Warning;
 
-public class SizeExtraFieldTest {
+public class ZipEntryTypeExtraFieldTest {
     private static final byte[] ZERO_AS_BYTE_ARRAY = {0, 0, 0, 0, 0, 0, 0, 0};
-    private static final byte[] _123456789ABCDEF0_AS_LE_BYTE_ARRAY = new byte[] {(byte) 0xF0,
(byte) 0xDE, (byte) 0xBC, (byte) 0x9A, 0x78, 0x56, 0x34, 0x12};
-    private static final byte[] FEDCBA9876543210_AS_LE_BYTE_ARRAY = new byte[] {0x10, 0x32,
0x54, 0x76, (byte) 0x98, (byte) 0xBA, (byte) 0xDC, (byte) 0xFE};
-    private static final byte[] UNUSED = new byte[] {(byte) 0xDE, (byte) 0xAD};
+    private static final byte[] ONE_AS_BYTE_ARRAY = {1, 0, 0, 0, 0, 0, 0, 0};
+    private static final byte[] TWO_AS_BYTE_ARRAY = {2, 0, 0, 0, 0, 0, 0, 0};
+    private static final byte[] THREE_AS_BYTE_ARRAY = {3, 0, 0, 0, 0, 0, 0, 0};
+    private static final byte[] FOUR_AS_BYTE_ARRAY = {4, 0, 0, 0, 0, 0, 0, 0};
 
-    private SizeExtraField testee;
+    private EntryTypeExtraField testee;
 
     @BeforeEach
     void setUp() {
-        testee = new SizeExtraField();
+        testee = new EntryTypeExtraField();
     }
 
     @Test
-    public void shouldMatchBeanContract() {
-        EqualsVerifier.forClass(SizeExtraField.class)
+    void shouldMatchBeanContract() {
+        EqualsVerifier.forClass(EntryTypeExtraField.class)
             .suppress(Warning.NONFINAL_FIELDS)
             .verify();
     }
@@ -70,7 +73,7 @@ public class SizeExtraFieldTest {
         ByteBuffer byteBuffer = ByteBuffer.wrap(testee.getHeaderId().getBytes())
             .order(ByteOrder.LITTLE_ENDIAN);
         assertThat(Charsets.US_ASCII.decode(byteBuffer).toString())
-            .isEqualTo("aj");
+            .isEqualTo("aq");
     }
 
     @Test
@@ -80,21 +83,27 @@ public class SizeExtraFieldTest {
     }
 
     @Test
-    void getLocalFileDataDataShouldReturnZeroWhenZero() {
-        byte[] actual = new SizeExtraField(0).getLocalFileDataData();
+    void getLocalFileDataShouldReturnValueInLittleIndianWhenMailbox() {
+        byte[] actual = new EntryTypeExtraField(ZipEntryType.MAILBOX).getLocalFileDataData();
         assertThat(actual).isEqualTo(ZERO_AS_BYTE_ARRAY);
     }
 
     @Test
-    void getLocalFileDataDataShouldReturnValueInLittleIndianWhen123456789ABCDEF0() {
-        byte[] actual = new SizeExtraField(0x123456789ABCDEF0L).getLocalFileDataData();
-        assertThat(actual).isEqualTo(_123456789ABCDEF0_AS_LE_BYTE_ARRAY);
+    void getLocalFileDataShouldReturnValueInLittleIndianWhenMailboxAnnotationDir() {
+        byte[] actual = new EntryTypeExtraField(ZipEntryType.MAILBOX_ANNOTATION_DIR).getLocalFileDataData();
+        assertThat(actual).isEqualTo(ONE_AS_BYTE_ARRAY);
     }
 
     @Test
-    void getLocalFileDataDataShouldReturnValueInLittleIndianWhenFEDCBA9876543210() {
-        byte[] actual = new SizeExtraField(0xFEDCBA9876543210L).getLocalFileDataData();
-        assertThat(actual).isEqualTo(FEDCBA9876543210_AS_LE_BYTE_ARRAY);
+    void getLocalFileDataShouldReturnValueInLittleIndianWhenMailboxAnnotation() {
+        byte[] actual = new EntryTypeExtraField(ZipEntryType.MAILBOX_ANNOTATION).getLocalFileDataData();
+        assertThat(actual).isEqualTo(TWO_AS_BYTE_ARRAY);
+    }
+
+    @Test
+    void getLocalFileDataShouldReturnValueInLittleIndianWhenMessage() {
+        byte[] actual = new EntryTypeExtraField(ZipEntryType.MESSAGE).getLocalFileDataData();
+        assertThat(actual).isEqualTo(THREE_AS_BYTE_ARRAY);
     }
 
     @Test
@@ -104,68 +113,44 @@ public class SizeExtraFieldTest {
     }
 
     @Test
-    void getCentralDirectoryDataShouldReturnZeroWhenZero() {
-        byte[] actual = new SizeExtraField(0).getCentralDirectoryData();
+    void getCentralDirectoryDataShouldReturnValueInLittleIndianWhenMailbox() {
+        byte[] actual = new EntryTypeExtraField(ZipEntryType.MAILBOX).getCentralDirectoryData();
         assertThat(actual).isEqualTo(ZERO_AS_BYTE_ARRAY);
     }
 
     @Test
-    void getCentralDirectoryDataShouldReturnValueInLittleIndianWhen123456789ABCDEF0() {
-        byte[] actual = new SizeExtraField(0x123456789ABCDEF0L).getCentralDirectoryData();
-        assertThat(actual).isEqualTo(_123456789ABCDEF0_AS_LE_BYTE_ARRAY);
+    void getCentralDirectoryDataShouldReturnValueInLittleIndianWhenMailboxAnnotationDir()
{
+        byte[] actual = new EntryTypeExtraField(ZipEntryType.MAILBOX_ANNOTATION_DIR).getCentralDirectoryData();
+        assertThat(actual).isEqualTo(ONE_AS_BYTE_ARRAY);
     }
 
     @Test
-    void getCentralDirectoryDataShouldReturnValueInLittleIndianWhenFEDCBA9876543210() {
-        byte[] actual = new SizeExtraField(0xFEDCBA9876543210L).getCentralDirectoryData();
-        assertThat(actual).isEqualTo(FEDCBA9876543210_AS_LE_BYTE_ARRAY);
+    void getCentralDirectoryDataShouldReturnValueInLittleIndianWhenMailboxAnnotation() {
+        byte[] actual = new EntryTypeExtraField(ZipEntryType.MAILBOX_ANNOTATION).getCentralDirectoryData();
+        assertThat(actual).isEqualTo(TWO_AS_BYTE_ARRAY);
+    }
+
+    @Test
+    void getCentralDirectoryDataShouldReturnValueInLittleIndianWhenMessage() {
+        byte[] actual = new EntryTypeExtraField(ZipEntryType.MESSAGE).getCentralDirectoryData();
+        assertThat(actual).isEqualTo(THREE_AS_BYTE_ARRAY);
     }
 
     @Test
     void parseFromLocalFileDataShouldThrownWhenLengthIsSmallerThan8() {
-        byte[] input = new byte[] {0, 0, 0, 0, 0, 0, 0};
+        byte[] input = new byte[7];
         assertThatThrownBy(() -> testee.parseFromLocalFileData(input, 0, 7))
             .isInstanceOf(ZipException.class);
     }
 
     @Test
     void parseFromLocalFileDataShouldThrownWhenLengthIsBiggerThan8() {
-        byte[] input = new byte[] {0, 0, 0, 0, 0, 0, 0, 0, 0};
+        byte[] input = new byte[8];
         assertThatThrownBy(() -> testee.parseFromLocalFileData(input, 0, 9))
             .isInstanceOf(ZipException.class);
     }
 
     @Test
-    void parseFromLocalFileDataShouldParseWhenZero() throws Exception {
-        testee.parseFromLocalFileData(ZERO_AS_BYTE_ARRAY, 0, 8);
-        assertThat(testee.getValue())
-            .contains(0L);
-    }
-
-    @Test
-    void parseFromLocalFileDataShouldParseWhen123456789ABCDEF0InLittleEndian() throws Exception
{
-        testee.parseFromLocalFileData(_123456789ABCDEF0_AS_LE_BYTE_ARRAY, 0, 8);
-        assertThat(testee.getValue())
-            .contains(0x123456789ABCDEF0L);
-    }
-
-    @Test
-    void parseFromLocalFileDataShouldParseWhenFEDCBA9876543210InLittleEndian() throws Exception
{
-        byte[] input = FEDCBA9876543210_AS_LE_BYTE_ARRAY;
-        testee.parseFromLocalFileData(input, 0, 8);
-        assertThat(testee.getValue())
-            .contains(0xFEDCBA9876543210L);
-    }
-
-    @Test
-    void parseFromLocalFileDataShouldHandleOffset() throws Exception {
-        byte[] input = Bytes.concat(UNUSED, _123456789ABCDEF0_AS_LE_BYTE_ARRAY);
-        testee.parseFromLocalFileData(input, 2, 8);
-        assertThat(testee.getValue())
-            .contains(0x123456789ABCDEF0L);
-    }
-
-    @Test
     void parseFromCentralDirectoryDataShouldThrownWhenLengthIsSmallerThan8() {
         byte[] input = new byte[7];
         assertThatThrownBy(() -> testee.parseFromCentralDirectoryData(input, 0, 7))
@@ -180,32 +165,13 @@ public class SizeExtraFieldTest {
     }
 
     @Test
-    void parseFromCentralDirectoryDataShouldParseWhenZero() throws Exception {
-        testee.parseFromCentralDirectoryData(ZERO_AS_BYTE_ARRAY, 0, 8);
-        assertThat(testee.getValue())
-            .contains(0L);
-    }
-
-    @Test
-    void parseFromCentralDirectoryDataShouldParseWhen123456789ABCDEF0InLittleEndian() throws
Exception {
-        testee.parseFromCentralDirectoryData(_123456789ABCDEF0_AS_LE_BYTE_ARRAY, 0, 8);
+    void parseFromCentralDirectoryDataShouldParseWhenNotAnEnumValue() throws Exception {
+        testee.parseFromCentralDirectoryData(FOUR_AS_BYTE_ARRAY, 0, 8);
         assertThat(testee.getValue())
-            .contains(0x123456789ABCDEF0L);
-    }
+            .contains(4L);
 
-    @Test
-    void parseFromCentralDirectoryDataShouldParseWhenFEDCBA9876543210InLittleEndian() throws
Exception {
-        byte[] input = FEDCBA9876543210_AS_LE_BYTE_ARRAY;
-        testee.parseFromCentralDirectoryData(input, 0, 8);
-        assertThat(testee.getValue())
-            .contains(0xFEDCBA9876543210L);
+        assertThat(testee.getEnumValue())
+            .isEqualTo(Optional.empty());
     }
 
-    @Test
-    void parseFromCentralDirectoryDataShouldHandleOffset() throws Exception {
-        byte[] input = Bytes.concat(UNUSED, _123456789ABCDEF0_AS_LE_BYTE_ARRAY);
-        testee.parseFromCentralDirectoryData(input, 2, 8);
-        assertThat(testee.getValue())
-            .contains(0x123456789ABCDEF0L);
-    }
 }
diff --git a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/ZipperTest.java
b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/ZipperTest.java
index 699769a..79607b3 100644
--- a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/ZipperTest.java
+++ b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/ZipperTest.java
@@ -46,6 +46,14 @@ import java.io.ByteArrayOutputStream;
 import java.util.List;
 import java.util.stream.Stream;
 
+import org.apache.james.mailbox.backup.zip.FlagsExtraField;
+import org.apache.james.mailbox.backup.zip.InternalDateExtraField;
+import org.apache.james.mailbox.backup.zip.MailboxIdExtraField;
+import org.apache.james.mailbox.backup.zip.MessageIdExtraField;
+import org.apache.james.mailbox.backup.zip.SizeExtraField;
+import org.apache.james.mailbox.backup.zip.UidExtraField;
+import org.apache.james.mailbox.backup.zip.UidValidityExtraField;
+import org.apache.james.mailbox.backup.zip.Zipper;
 import org.apache.james.mailbox.model.MessageResult;
 import org.apache.james.mailbox.store.MessageResultImpl;
 import org.junit.jupiter.api.BeforeAll;
diff --git a/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/DeletedMessageZipper.java
b/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/DeletedMessageZipper.java
index bf76384..ce32e8e 100644
--- a/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/DeletedMessageZipper.java
+++ b/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/DeletedMessageZipper.java
@@ -30,8 +30,8 @@ import org.apache.commons.compress.archivers.zip.ExtraFieldUtils;
 import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
 import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
 import org.apache.commons.io.IOUtils;
-import org.apache.james.mailbox.backup.MessageIdExtraField;
-import org.apache.james.mailbox.backup.SizeExtraField;
+import org.apache.james.mailbox.backup.zip.MessageIdExtraField;
+import org.apache.james.mailbox.backup.zip.SizeExtraField;
 import org.apache.james.mailbox.model.MessageId;
 
 import com.github.fge.lambdas.Throwing;
diff --git a/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/DeletedMessageZipperTest.java
b/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/DeletedMessageZipperTest.java
index d9a33f2..195206f 100644
--- a/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/DeletedMessageZipperTest.java
+++ b/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/DeletedMessageZipperTest.java
@@ -51,8 +51,8 @@ import java.util.concurrent.atomic.AtomicReference;
 import java.util.stream.Stream;
 
 import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
-import org.apache.james.mailbox.backup.MessageIdExtraField;
-import org.apache.james.mailbox.backup.SizeExtraField;
+import org.apache.james.mailbox.backup.zip.MessageIdExtraField;
+import org.apache.james.mailbox.backup.zip.SizeExtraField;
 import org.apache.james.mailbox.backup.ZipAssert;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Nested;


---------------------------------------------------------------------
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