Package netscape.ldap

Class LDAPResourceBundle

java.lang.Object
netscape.ldap.LDAPResourceBundle
All Implemented Interfaces:
Serializable

class LDAPResourceBundle extends Object implements Serializable
This class represents a locale-specific resource for a property file. It retrieves the property file for the given base name including the absolute path name and locale. The property file has to be located in the CLASSPATH and the property file's suffix is .props.

If the specified locale is en and us and the base name of the file is netscape/ldap/errors/ErrorCodes, then the class loader will search for the file in the following order:


   ErrorCodes_en_us.props
   ErrorCodes_en.props
   ErrorCodes.props

 
See Also:
  • Field Details

  • Constructor Details

    • LDAPResourceBundle

      LDAPResourceBundle()
  • Method Details

    • getBundle

      static PropertyResourceBundle getBundle(String baseName) throws IOException
      Return the property resource bundle according to the base name of the property file and the locale. The class loader will find the closest match with the given locale.
      Returns:
      the property resource bundle.
      Throws:
      IOException - Gets thrown when failed to open the resource bundle file.
    • getBundle

      static PropertyResourceBundle getBundle(String baseName, Locale l) throws IOException
      Return the property resource bundle according to the base name of the property file and the locale. The class loader will find the closest match with the given locale.
      Parameters:
      baseName - the base name of the property file. The base name contains no locale context and no . suffix.
      l - the locale
      Returns:
      the property resource bundle.
      Throws:
      IOException - Gets thrown when failed to create a property resource
    • getStream

      private static InputStream getStream(String baseName, String locale)
      Constructs the whole absolute path name of a property file and retrieves an input stream on the file.
      Parameters:
      baseName - the base name of the property file. The base name contains no locale context and no . suffix.
      the - locale string to insert into the file name
      Returns:
      the input stream of the property file.
    • printDebug

      private static void printDebug(String str)
      Prints debug messages if the debug mode is on.
      Parameters:
      str - the message that is printed