[ 
https://issues.apache.org/jira/browse/SLING-8105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16685813#comment-16685813
 ] 

ASF GitHub Bot commented on SLING-8105:
---------------------------------------

DominikSuess closed pull request #7: SLING-8105 - checking for filelenght to 
skip truncated files and allo…
URL: 
https://github.com/apache/sling-org-apache-sling-feature-extension-content/pull/7
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/src/main/java/org/apache/sling/feature/extension/content/ContentHandler.java 
b/src/main/java/org/apache/sling/feature/extension/content/ContentHandler.java
index 8986d41..d85b083 100644
--- 
a/src/main/java/org/apache/sling/feature/extension/content/ContentHandler.java
+++ 
b/src/main/java/org/apache/sling/feature/extension/content/ContentHandler.java
@@ -57,7 +57,7 @@ private static ExecutionPlanBuilder 
buildExecutionPlan(Collection<Artifact> arti
 
         for (final Artifact a : artifacts) {
             final File file = prepareContext.getArtifactFile(a.getId());
-            if (file.exists()) {
+            if (file.exists() && file.length() > 0) {
                 packageReferences.add(file);
             }
 
@@ -125,7 +125,6 @@ public boolean handle(Extension extension, 
LauncherPrepareContext prepareContext
             installationContext.addConfiguration(initcfg.getPid(), 
initcfg.getFactoryPid(), initcfg.getProperties());
          // Workaround for too bold relocation mechanism - corresponding 
details at https://issues.apache.org/jira/browse/MSHADE-156 
             final Configuration registrycfg = new 
Configuration("org.UNSHADE.apache.jackrabbit.vault.packaging.registry.impl.FSPackageRegistry");
-            registrycfg.getProperties().put("homePath", REGISTRY_FOLDER);
             installationContext.addConfiguration(registrycfg.getPid(), 
registrycfg.getFactoryPid(), registrycfg.getProperties());;
 
             return true;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Make ContentHandler able to handle/ignore truncated files
> ---------------------------------------------------------
>
>                 Key: SLING-8105
>                 URL: https://issues.apache.org/jira/browse/SLING-8105
>             Project: Sling
>          Issue Type: Improvement
>          Components: Feature Model
>            Reporter: Dominik Süß
>            Assignee: Dominik Süß
>            Priority: Major
>
> The logic in ContentHandler may be improved to not just check for file 
> existence but also crosscheck if files got truncated. This mechanism is used 
> to prevent other tooling to filter out the artifacts on subsequent startup 
> whereas installation already happened in previous startups. Truncation 
> therefore is a mechanism in container based setups to effectively reduce 
> diskusage without functional impact.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to