You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2023/04/11 09:17:19 UTC

[pulsar] branch master updated: [fix][misc] Support .nar files without explicit directory entries (#19304)

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

lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new dc1cdacab8e [fix][misc] Support .nar files without explicit directory entries (#19304)
dc1cdacab8e is described below

commit dc1cdacab8eadbd3f9d207e66d4aefbca8bca920
Author: Lari Hotari <lh...@users.noreply.github.com>
AuthorDate: Tue Apr 11 12:17:11 2023 +0300

    [fix][misc] Support .nar files without explicit directory entries (#19304)
    
    Co-authored-by: tison <wa...@gmail.com>
---
 .../src/main/java/org/apache/pulsar/common/nar/NarUnpacker.java         | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pulsar-common/src/main/java/org/apache/pulsar/common/nar/NarUnpacker.java b/pulsar-common/src/main/java/org/apache/pulsar/common/nar/NarUnpacker.java
index a71589e6d64..9bd5bc48df8 100644
--- a/pulsar-common/src/main/java/org/apache/pulsar/common/nar/NarUnpacker.java
+++ b/pulsar-common/src/main/java/org/apache/pulsar/common/nar/NarUnpacker.java
@@ -122,6 +122,8 @@ public class NarUnpacker {
                 if (jarEntry.isDirectory()) {
                     FileUtils.ensureDirectoryExistAndCanReadAndWrite(f);
                 } else {
+                    // The directory entry might appear after the file entry
+                    FileUtils.ensureDirectoryExistAndCanReadAndWrite(f.getParentFile());
                     makeFile(jarFile.getInputStream(jarEntry), f);
                 }
             }