// first a compatibility check with the old (wrong) ISO9075
// encoding
final String path = ISO9075.encodePath(name);
try {
if ( node.hasProperty(path) ) {
return new JcrPropertyMapCacheEntry(node.getProperty(path));
}
} catch (final RepositoryException re) {
throw new IllegalArgumentException(re);
}
// now we do a proper segment by segment encoding
final StringBuilder sb = new StringBuilder();
int pos = 0;
int lastPos = -1;
while ( pos < name.length() ) {
if ( name.charAt(pos) == '/' ) {
if ( lastPos + 1 < pos ) {
sb.append(Text.escapeIllegalJcrChars(name.substring(lastPos + 1, pos)));
}
sb.append('/');
lastPos = pos;
}
pos++;
}
if ( lastPos + 1 < pos ) {
sb.append(Text.escapeIllegalJcrChars(name.substring(lastPos + 1)));
}
final String newPath = sb.toString();
try {
if ( node.hasProperty(newPath) ) {
return new JcrPropertyMapCacheEntry(node.getProperty(newPath));
}
} catch (final RepositoryException re) {
throw new IllegalArgumentException(re);
}
return null;
}
// check cache
JcrPropertyMapCacheEntry cachedValued = cache.get(name);
if ( fullyRead || cachedValued != null ) {
return cachedValued;
}
try {