You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2019/09/05 12:27:43 UTC

[sling-org-apache-sling-installer-factory-packages] branch master updated: bail out early in case we are not dealing with a .zip file

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

kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-factory-packages.git


The following commit(s) were added to refs/heads/master by this push:
     new adf72bd  bail out early in case we are not dealing with a .zip file
adf72bd is described below

commit adf72bd58076748b15737e29803db7985bcba5ef
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Thu Sep 5 14:27:37 2019 +0200

    bail out early in case we are not dealing with a .zip file
---
 .../sling/installer/factory/packages/impl/PackageTransformer.java      | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/main/java/org/apache/sling/installer/factory/packages/impl/PackageTransformer.java b/src/main/java/org/apache/sling/installer/factory/packages/impl/PackageTransformer.java
index 1d306ee..344b930 100644
--- a/src/main/java/org/apache/sling/installer/factory/packages/impl/PackageTransformer.java
+++ b/src/main/java/org/apache/sling/installer/factory/packages/impl/PackageTransformer.java
@@ -114,6 +114,9 @@ public class PackageTransformer implements ResourceTransformer, InstallTaskFacto
      * @param resource The resource
      * @return {@code null} if not a content package, a result otherwise */
     private TransformationResult[] checkForPackage(final RegisteredResource resource) {
+        if (!resource.getURL().endsWith(".zip")) {
+            return null;
+        }
         // first check if this is a zip archive
         try (final ZipInputStream zin = new ZipInputStream(new BufferedInputStream(resource.getInputStream()))) {
             if (zin.getNextEntry() == null) {