X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.support.jcr%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fjcr%2FSlcJcrUtils.java;h=52931218bcbe1c15142c9ec4744b16c6b55c9304;hb=d50c0fe50cd69947bc7146991afa0826a8c8f53b;hp=81504b77657f70689673802ddbe3613b07664047;hpb=4444b88528fd1ba4de62d47bf885bbe9403d2216;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/SlcJcrUtils.java b/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/SlcJcrUtils.java index 81504b776..52931218b 100644 --- a/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/SlcJcrUtils.java +++ b/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/SlcJcrUtils.java @@ -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; } /**