+ /** Caller must logout the underlying session. */
+ protected Node newDistribution(String distributionId) {
+ Session session = null;
+ try {
+ session = JcrUtils.loginOrCreateWorkspace(rpmRepository,
+ distributionId);
+ JcrUtils.addPrivilege(session, "/", "anonymous", "jcr:read");
+ JcrUtils.addPrivilege(session, "/", SlcConstants.ROLE_SLC,
+ "jcr:all");
+
+ Calendar now = new GregorianCalendar();
+ String folderName = dateFormat.format(now.getTime());
+ return JcrUtils.mkfolders(session, "/" + folderName);
+ } catch (Exception e) {
+ JcrUtils.logoutQuietly(session);
+ throw new SlcException("Cannot initialize distribution workspace "
+ + distributionId, e);
+ }
+ }
+