Class ProviderUtils

java.lang.Object
com.netscape.jndi.ldap.ProviderUtils

class ProviderUtils extends Object
Common utility methods
  • Field Details

  • Constructor Details

    • ProviderUtils

      ProviderUtils()
  • Method Details

    • jndiSearchScopeToLdap

      static int jndiSearchScopeToLdap(int jndiScope) throws NamingException
      Throws:
      NamingException
    • attributesToFilter

      static String attributesToFilter(Attributes attrs) throws NamingException
      Convert Attribute List to a LDAP filter
      Parameters:
      attrs - An Attribute List
      Returns:
      LDAP Filter
      Throws:
      NamingException
    • expandFilterExpr

      static String expandFilterExpr(String filterExpr, Object[] filterArgs) throws InvalidSearchFilterException
      Expand filterExpr. Each occurrence of a variable "{n}", where n is a non-negative integer, is replaced with a variable from the filterArgs array indexed by the 'n'. FilterArgs can be Strings or byte[] and they are escaped according to the RFC2254
      Throws:
      InvalidSearchFilterException
    • escapeString

      static String escapeString(String str)
      Escape a string according to the RFC 2254
    • escapeBytes

      static String escapeBytes(byte[] bytes)
    • testAttributesToFilter

      private static void testAttributesToFilter()
      A method used only for testing
    • testFilterExpr

      private static void testFilterExpr()
      A method used only for testing
    • main

      public static void main(String[] args)
      Test