From: Mathieu Baudier Date: Thu, 9 Feb 2012 09:41:25 +0000 (+0000) Subject: Fix special characters in JCR logging X-Git-Tag: argeo-slc-2.1.7~824 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=038f9fd2f7be36befe4427b4a85a55bddb207c4a;p=gpl%2Fargeo-slc.git Fix special characters in JCR logging git-svn-id: https://svn.argeo.org/slc/trunk@5025 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrExecutionProcess.java b/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrExecutionProcess.java index b2fa33395..83b442fbf 100644 --- a/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrExecutionProcess.java +++ b/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrExecutionProcess.java @@ -88,6 +88,11 @@ public class JcrExecutionProcess implements ExecutionProcess, SlcNames { String relPath = SLC_LOG + '/' + step.getThread() + '/' + step.getLocation().replace('.', '/'); String path = node.getPath() + '/' + relPath; + // clean special character + // TODO factorize in JcrUtils + path = path.replace('@', '_').replace('/', '_') + .replace(':', '_'); + Node location = JcrUtils.mkdirs(node.getSession(), path); Node logEntry = location.addNode(Long.toString(nextLogLine), type); @@ -106,7 +111,7 @@ public class JcrExecutionProcess implements ExecutionProcess, SlcNames { JcrUtils.updateLastModified(node); node.getSession().save(); - } catch (RepositoryException e) { + } catch (Exception e) { JcrUtils.discardUnderlyingSessionQuietly(node); e.printStackTrace(); }