Hi Bruce You could try authenticating your WebDAV connection with the admin credentials. If that works, it's likely to be an issue with the setup of your JCR permissions. You may well be connecting as anonymous currently and therefore be denied writes (I'm not familiar with the vanilla Sling permission setup).
Regards Julian On Wednesday, November 26, 2014, Bruce Edge <[email protected]> wrote: > Apologies for asking something that seems like it should be so simple. > What else do I need to make a node that I create using > JcrUtils.getOrCreateByPath(..) be writable from WebDAV? > > adminResolver = resolverFactory.getAdministrativeResourceResolver(null); > adminSession = adminResolver.adaptTo(Session.class); > Node destinationNode = JcrUtils.getOrCreateByPath(destination, > JcrConstants.NT_FOLDER, adminSession); > destinationNode.addMixin(JcrConstants.MIX_LOCKABLE); > destinationNode.addMixin(JcrConstants.MIX_VERSIONABLE); > adminSession.save(); > Lock lock = lockManager.lock(destination, true, true, Long.MAX_VALUE, > NimJcrConstants.INGEST_JOB_TOPIC); > > VersionManager versionManager = workspace.getVersionManager(); > > versionManager.checkout(destination); > > I'm calling a legacy library that expects a writable destination folder. > I'm passing the WebDAV folder name and failing with: > > java.io.FileNotFoundException: /mnt/jcr/test/test.txt (Permission denied) > > The file system view shows the folder is owned by my UID rather than the > UID of the sling daemon: > %> ls -ld /mnt/jcr/test > drwx------ 1 bedge staff 2048 Nov 25 16:05 /mnt/jcr/test > > Can I set the file system permissions using javax.jcr? > > -Bruce >
