You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ss...@apache.org on 2023/10/20 08:23:13 UTC

[sling-org-apache-sling-feature-cpconverter] branch master updated: SLING-12113 CPConverter: Improve error message "File being unzipped is too big" for Sling-Initial-Content (#172)

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

sseifert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-cpconverter.git


The following commit(s) were added to refs/heads/master by this push:
     new 7d64cf3  SLING-12113 CPConverter: Improve error message "File being unzipped is too big" for Sling-Initial-Content (#172)
7d64cf3 is described below

commit 7d64cf3ff804cb0ba3d71a55dcd953fa893d9512
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Fri Oct 20 10:23:08 2023 +0200

    SLING-12113 CPConverter: Improve error message "File being unzipped is too big" for Sling-Initial-Content (#172)
---
 .../SlingInitialContentBundleEntryMetaDataCollector.java | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/sling/feature/cpconverter/handlers/slinginitialcontent/SlingInitialContentBundleEntryMetaDataCollector.java b/src/main/java/org/apache/sling/feature/cpconverter/handlers/slinginitialcontent/SlingInitialContentBundleEntryMetaDataCollector.java
index e8f85fd..4c6dbe2 100644
--- a/src/main/java/org/apache/sling/feature/cpconverter/handlers/slinginitialcontent/SlingInitialContentBundleEntryMetaDataCollector.java
+++ b/src/main/java/org/apache/sling/feature/cpconverter/handlers/slinginitialcontent/SlingInitialContentBundleEntryMetaDataCollector.java
@@ -16,12 +16,6 @@
  */
 package org.apache.sling.feature.cpconverter.handlers.slinginitialcontent;
 
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.sling.feature.cpconverter.ContentPackage2FeatureModelConverter;
-import org.apache.sling.jcr.contentloader.PathEntry;
-import org.jetbrains.annotations.NotNull;
-
 import java.io.BufferedInputStream;
 import java.io.BufferedOutputStream;
 import java.io.File;
@@ -43,6 +37,13 @@ import java.util.jar.JarFile;
 import java.util.jar.JarOutputStream;
 import java.util.jar.Manifest;
 
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.sling.feature.cpconverter.ContentPackage2FeatureModelConverter;
+import org.apache.sling.jcr.contentloader.PathEntry;
+import org.jetbrains.annotations.NotNull;
+
 /**
  * Handles collecting the metadata for each sling initial content entry, to be used for extraction in another loop
  */
@@ -103,7 +104,8 @@ class SlingInitialContentBundleEntryMetaDataCollector {
                 }
 
                 if (total.get() + BUFFER > TOOBIG) {
-                    throw new IllegalStateException("File being unzipped is too big.");
+                    throw new IllegalStateException("Sling-Initial-Content: File content being unzipped is too big "
+                            + "(>" +  FileUtils.byteCountToDisplaySize(TOOBIG) + "): " + context.getPath());
                 }
             }
         }