]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/SlcJcrUtils.java
Refactor JCR utils and home usage
[gpl/argeo-slc.git] / runtime / org.argeo.slc.support.jcr / src / main / java / org / argeo / slc / jcr / SlcJcrUtils.java
index 81504b77657f70689673802ddbe3613b07664047..52931218bcbe1c15142c9ec4744b16c6b55c9304 100644 (file)
@@ -21,8 +21,10 @@ import java.util.GregorianCalendar;
 import javax.jcr.Node;
 import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
+import javax.jcr.Session;
 
 import org.argeo.jcr.JcrUtils;
+import org.argeo.jcr.UserJcrUtils;
 import org.argeo.slc.SlcException;
 import org.argeo.slc.core.execution.PrimitiveAccessor;
 import org.argeo.slc.core.execution.PrimitiveUtils;
@@ -80,11 +82,16 @@ public class SlcJcrUtils implements SlcNames {
                                + JcrUtils.dateAsPath(now, true) + uuid;
        }
 
-       /** Create a new execution result path based on the current time */
-       public static String createResultPath(String username, String uuid) {
+       /**
+        * Create a new execution result path in the user home based on the current
+        * time
+        */
+       public static String createResultPath(Session session, String uuid)
+                       throws RepositoryException {
                Calendar now = new GregorianCalendar();
-               return JcrUtils.getUserHomePath(username) + '/' + SlcNames.SLC_RESULTS
-                               + '/' + JcrUtils.dateAsPath(now, true) + uuid;
+               return UserJcrUtils.getUserHome(session).getPath() + '/'
+                               + SlcNames.SLC_RESULTS + '/' + JcrUtils.dateAsPath(now, true)
+                               + uuid;
        }
 
        /**