use of org.apache.jackrabbit.webdav.jcr.property.LengthsProperty in project jackrabbit by apache.
the class DefaultItemResource method getProperty.
@Override
public DavProperty<?> getProperty(DavPropertyName name) {
DavProperty prop = super.getProperty(name);
if (prop == null && exists()) {
try {
Property p = (Property) item;
if (isMultiple()) {
if (JCR_LENGTHS.equals(name)) {
prop = new LengthsProperty(p.getLengths());
}
} else {
if (JCR_LENGTH.equals(name)) {
long length = p.getLength();
prop = new DefaultDavProperty<String>(JCR_LENGTH, String.valueOf(length), true);
} else if (JCR_GET_STRING.equals(name) && p.getType() != PropertyType.BINARY) {
// getstring property is only created for single value
// non-binary jcr properties
prop = new DefaultDavProperty<String>(JCR_GET_STRING, p.getString(), true);
}
}
} catch (RepositoryException e) {
log.error("Failed to retrieve resource properties: " + e.getMessage());
}
}
return prop;
}
Aggregations