james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r959737 - in /james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr: mail/JCRMailboxMapper.java user/JCRSubscriptionMapper.java
Date Thu, 01 Jul 2010 18:09:57 GMT
Author: norman
Date: Thu Jul  1 18:09:57 2010
New Revision: 959737

URL: http://svn.apache.org/viewvc?rev=959737&view=rev
Log:
Escape mailboxname before create the node (IMAP-174)

Modified:
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java

Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java?rev=959737&r1=959736&r2=959737&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java
(original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java
Thu Jul  1 18:09:57 2010
@@ -32,6 +32,7 @@ import javax.jcr.query.QueryResult;
 import org.apache.commons.logging.Log;
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.commons.JcrUtils;
+import org.apache.jackrabbit.util.Text;
 import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.jcr.AbstractJCRScalingMapper;
 import org.apache.james.imap.jcr.MailboxSessionJCRRepository;
@@ -191,9 +192,9 @@ public class JCRMailboxMapper extends Ab
                         
                         //split the name so we can construct a nice node tree
                         final String nameParts[] = name.split("\\" + String.valueOf(delimiter),
3);
-                        node = JcrUtils.getOrAddNode(node, nameParts[0], "nt:unstructured");
-                        node = createUserPathStructure(node, nameParts[1]);
-                        node = JcrUtils.getOrAddNode(node, nameParts[2], "nt:unstructured");
+                        node = JcrUtils.getOrAddNode(node, Text.escapeIllegalJcrChars(nameParts[0]),
"nt:unstructured");
+                        node = createUserPathStructure(node, Text.escapeIllegalJcrChars(nameParts[1]));
+                        node = JcrUtils.getOrAddNode(node, Text.escapeIllegalJcrChars(nameParts[2]),
"nt:unstructured");
                         node.addMixin("jamesMailbox:mailbox");
                         
                         

Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java?rev=959737&r1=959736&r2=959737&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java
(original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java
Thu Jul  1 18:09:57 2010
@@ -33,6 +33,7 @@ import javax.jcr.query.QueryResult;
 
 import org.apache.commons.logging.Log;
 import org.apache.jackrabbit.commons.JcrUtils;
+import org.apache.jackrabbit.util.Text;
 import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.jcr.AbstractJCRScalingMapper;
 import org.apache.james.imap.jcr.JCRImapConstants;
@@ -175,10 +176,10 @@ public class JCRSubscriptionMapper exten
             // its a new subscription
             if (sub == null) {
                 node = JcrUtils.getOrAddNode(getSession().getRootNode(), MAILBOXES_PATH);
-                node = JcrUtils.getOrAddNode(node, StoreConstants.USER_NAMESPACE_PREFIX);
+                node = JcrUtils.getOrAddNode(node, Text.escapeIllegalJcrChars(StoreConstants.USER_NAMESPACE_PREFIX));
 
                 // This is needed to minimize the child nodes a bit
-                node = createUserPathStructure(node, username);
+                node = createUserPathStructure(node, Text.escapeIllegalJcrChars(username));
             } else {
                 node = sub.getNode();
             }



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message