You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2020/01/16 10:03:20 UTC

[tomcat-jakartaee-migration] branch master updated: Fix processing of directories

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 60546ef  Fix processing of directories
60546ef is described below

commit 60546ef5fcc7f2b13680032dbc43eaf461397158
Author: remm <re...@apache.org>
AuthorDate: Thu Jan 16 11:03:10 2020 +0100

    Fix processing of directories
    
    Tested using the examples webapp from Tomcat 9 (exploded as with regular
    Tomcat), which runs.
---
 src/main/java/org/apache/tomcat/jakartaee/Migration.java | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/tomcat/jakartaee/Migration.java b/src/main/java/org/apache/tomcat/jakartaee/Migration.java
index 80fb2b1..c81dfd7 100644
--- a/src/main/java/org/apache/tomcat/jakartaee/Migration.java
+++ b/src/main/java/org/apache/tomcat/jakartaee/Migration.java
@@ -80,7 +80,14 @@ public class Migration {
     private void migrateDirectory(File src, File dest) throws IOException {
         String[] files = src.list();
         for (String file : files) {
-            migrateFile(new File(src, file), new File(dest, file));
+            File srcFile = new File(src, file);
+            File destFile = new File(dest, file);
+            if (srcFile.isDirectory()) {
+                destFile.mkdirs();
+                migrateDirectory(srcFile, destFile);
+            } else {
+                migrateFile(srcFile, destFile);
+            }
         }
     }
 


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