You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2016/11/24 16:09:27 UTC

svn commit: r1771171 - /sling/trunk/installer/providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java

Author: rombert
Date: Thu Nov 24 16:09:27 2016
New Revision: 1771171

URL: http://svn.apache.org/viewvc?rev=1771171&view=rev
Log:
SLING-5228 - Remove loginAdministrative() usage from
org.apache.sling.installer.provider.jcr

Converted the JcrInstaller to use loginService instead of
loginAdministrative.

Modified:
    sling/trunk/installer/providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java

Modified: sling/trunk/installer/providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java?rev=1771171&r1=1771170&r2=1771171&view=diff
==============================================================================
--- sling/trunk/installer/providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java (original)
+++ sling/trunk/installer/providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java Thu Nov 24 16:09:27 2016
@@ -209,7 +209,7 @@ public class JcrInstaller implements Upd
 
             try {
                 // open session
-                session = repository.loginAdministrative(repository.getDefaultWorkspace());
+                session = repository.loginService(repository.getDefaultWorkspace(), null);
 
                 for (final String path : cfg.getRoots()) {
                     listeners.add(new RootFolderListener(session, path, updateFoldersListTimer, cfg));
@@ -417,7 +417,7 @@ public class JcrInstaller implements Upd
         Session s = null;
 
         try {
-            s = repository.loginAdministrative(repository.getDefaultWorkspace());
+            s = repository.loginService(null, repository.getDefaultWorkspace());
             if (!s.itemExists(rootPath) || !s.getItem(rootPath).isNode() ) {
                 logger.info("Bundles root node {} not found, ignored", rootPath);
             } else {
@@ -529,6 +529,9 @@ public class JcrInstaller implements Upd
                     didRefresh = true;
                 }
                 counters[SCAN_FOLDERS_COUNTER]++;
+                
+                new RuntimeException("SCAN_FOLDERS_COUNTER is now " + counters[SCAN_FOLDERS_COUNTER]).printStackTrace();
+                
                 final WatchedFolder.ScanResult sr = wf.scan();
                 boolean toDo = false;
                 if ( sr.toAdd.size() > 0 ) {
@@ -643,7 +646,7 @@ public class JcrInstaller implements Upd
             logger.debug("Removing artifact at {}", path);
             Session session = null;
             try {
-                session = this.repository.loginAdministrative(null);
+                session = this.repository.loginService(null, null);
                 if ( session.itemExists(path) ) {
                     session.getItem(path).remove();
                     session.save();
@@ -720,7 +723,7 @@ public class JcrInstaller implements Upd
 
         Session session = null;
         try {
-            session = this.repository.loginAdministrative(null);
+            session = this.repository.loginService(null, null);
 
             final String path;
             boolean resourceIsMoved = true;