jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r1785214 - /jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/JcrPackageImpl.java
Date Fri, 03 Mar 2017 02:32:46 GMT
Author: tripod
Date: Fri Mar  3 02:32:46 2017
New Revision: 1785214

URL: http://svn.apache.org/viewvc?rev=1785214&view=rev
Log:
JCRVLT-162 package installation should not fully open the package when retrieving the package
id

Modified:
    jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/JcrPackageImpl.java

Modified: jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/JcrPackageImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/JcrPackageImpl.java?rev=1785214&r1=1785213&r2=1785214&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/JcrPackageImpl.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/JcrPackageImpl.java
Fri Mar  3 02:32:46 2017
@@ -80,6 +80,11 @@ import org.slf4j.LoggerFactory;
 public class JcrPackageImpl implements JcrPackage {
 
     /**
+     * max allowed package size for using a memory archive
+     */
+    public static final long MAX_MEMORY_ARCHIVE_SIZE = 1024*1024;
+
+    /**
      * default logger
      */
     private static final Logger log = LoggerFactory.getLogger(JcrPackageImpl.class);
@@ -300,7 +305,7 @@ public class JcrPackageImpl implements J
             } catch (RepositoryException e) {
                 // ignore
             }
-            if (!forceFileArchive && size >= 0 && size < 1024*1024)
{
+            if (!forceFileArchive && size >= 0 && size < MAX_MEMORY_ARCHIVE_SIZE)
{
                 MemoryArchive archive = new MemoryArchive(false);
                 InputStream in = getData().getStream();
                 try {
@@ -433,7 +438,11 @@ public class JcrPackageImpl implements J
 
                     // loop in the list of packages returned previously by package manager
                     for (JcrPackage listedPackage: listPackages) {
-                        PackageId listedPackageId = listedPackage.getPackage().getId();
+                        JcrPackageDefinition listedPackageDef = listedPackage.getDefinition();
+                        if (listedPackageDef == null) {
+                            continue;
+                        }
+                        PackageId listedPackageId = listedPackageDef.getId();
                         if (listedPackageId.equals(pId)) {
                             continue;
                         }
@@ -469,7 +478,7 @@ public class JcrPackageImpl implements J
             SubPackageHandling sb = pack.getSubPackageHandling();
             for (JcrPackageImpl p: subPacks) {
                 boolean skip = false;
-                PackageId id = p.getPackage().getId();
+                PackageId id = p.getDefinition().getId();
                 SubPackageHandling.Option option = sb.getOption(id);
                 String msg;
                 if (option == SubPackageHandling.Option.ADD || option == SubPackageHandling.Option.IGNORE)
{



Mime
View raw message