You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2022/09/06 10:20:40 UTC

[tomcat-jakartaee-migration] branch main updated: fixes #32 check if file name ends with manifest name (#33)

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-jakartaee-migration.git


The following commit(s) were added to refs/heads/main by this push:
     new db84422  fixes #32 check if file name ends with manifest name (#33)
db84422 is described below

commit db844223734b8c7f361f60a31b0f6f0235903c87
Author: wmccusker <11...@users.noreply.github.com>
AuthorDate: Tue Sep 6 03:20:36 2022 -0700

    fixes #32 check if file name ends with manifest name (#33)
    
    Check if file name ends with manifest name
    
    Support migration of manifest files in exploded archives
---
 .../org/apache/tomcat/jakartaee/ManifestConverter.java   |  2 +-
 .../apache/tomcat/jakartaee/ManifestConverterTest.java   | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java b/src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java
index 30e4ec0..a0e5f13 100644
--- a/src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java
+++ b/src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java
@@ -39,7 +39,7 @@ public class ManifestConverter implements Converter {
 
     @Override
     public boolean accepts(String filename) {
-        if (JarFile.MANIFEST_NAME.equals(filename)) {
+        if (filename.endsWith(JarFile.MANIFEST_NAME)) {
             return true;
         }
 
diff --git a/src/test/java/org/apache/tomcat/jakartaee/ManifestConverterTest.java b/src/test/java/org/apache/tomcat/jakartaee/ManifestConverterTest.java
new file mode 100644
index 0000000..c98dd21
--- /dev/null
+++ b/src/test/java/org/apache/tomcat/jakartaee/ManifestConverterTest.java
@@ -0,0 +1,16 @@
+package org.apache.tomcat.jakartaee;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+public class ManifestConverterTest {
+
+    @Test
+    public void testAccepts() {
+        ManifestConverter converter = new ManifestConverter();
+
+        assertTrue(converter.accepts("META-INF/MANIFEST.MF"));
+        assertTrue(converter.accepts("WEB-INF/bundles/com.example.bundle/META-INF/MANIFEST.MF"));
+    }
+}


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