Author: tolusha
Date: 2010-08-20 08:51:08 -0400 (Fri, 20 Aug 2010)
New Revision: 2960
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/PermissionValue.java
Log:
EXOJCR-908: fix parsing pemission value
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/PermissionValue.java
===================================================================
---
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/PermissionValue.java 2010-08-20
10:38:23 UTC (rev 2959)
+++
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/PermissionValue.java 2010-08-20
12:51:08 UTC (rev 2960)
@@ -18,7 +18,6 @@
*/
package org.exoplatform.services.jcr.impl.core.value;
-import org.exoplatform.services.jcr.access.AccessControlEntry;
import org.exoplatform.services.jcr.access.PermissionType;
import org.exoplatform.services.jcr.access.SystemIdentity;
import org.exoplatform.services.jcr.core.ExtendedPropertyType;
@@ -43,6 +42,8 @@
private static final int TYPE = ExtendedPropertyType.PERMISSION;
+ private static final String IDENTITY_DELIMITER = " ";
+
private String identity;
private String permission;
@@ -84,7 +85,7 @@
static public String[] parse(String pstring)
{
- StringTokenizer parser = new StringTokenizer(pstring,
AccessControlEntry.DELIMITER);
+ StringTokenizer parser = new StringTokenizer(pstring, IDENTITY_DELIMITER);
String identityString = parser.nextToken();
String permissionString = parser.nextToken();
@@ -112,6 +113,7 @@
/**
* {@inheritDoc}
*/
+ @Override
protected String getInternalString() throws ValueFormatException
{
return asString(identity, permission);
@@ -120,7 +122,7 @@
static protected String asString(String identity, String permission)
{
if (identity != null || permission != null) // SystemIdentity.ANY,
PermissionType.ALL
- return (identity != null ? identity : SystemIdentity.ANY) +
AccessControlEntry.DELIMITER
+ return (identity != null ? identity : SystemIdentity.ANY) + IDENTITY_DELIMITER
+ (permission != null ? permission : PermissionType.READ);
else
return "";