Class FilterEncoder
java.lang.Object
org.apache.directory.api.ldap.model.filter.FilterEncoder
An encoder for LDAP filters.
- Author:
- Apache Directory Project
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringencodeFilterValue(String value) Handles encoding of special characters in LDAP search filter assertion values using the <valueencoding> rule as described in RFC 4515.static StringFormats a filter and handles encoding of special characters in the value arguments using the <valueencoding> rule as described in RFC 4515.
-
Method Details
-
format
Formats a filter and handles encoding of special characters in the value arguments using the <valueencoding> rule as described in RFC 4515.Example of filter template format:
(&(cn={0})(uid={1}))- Parameters:
filterTemplate- the filter with placeholdersvalues- the values to encode and substitute- Returns:
- the formatted filter with escaped values
- Throws:
IllegalArgumentException- if the number of values does not match the number of placeholders in the template
-
encodeFilterValue
Handles encoding of special characters in LDAP search filter assertion values using the <valueencoding> rule as described in RFC 4515.- Parameters:
value- Right hand side of "attrId=value" assertion occurring in an LDAP search filter.- Returns:
- Escaped version of
value
-