Hi,

Recently I'm connecting with OpenLDAP server within Turbine.
But I have one problem with Configurations.java in Turbine package.
If I set the LDAP server properties likes

services.TurbineDirectoryService.properties.java.naming.security.principal=c
n=Manager, o=JNDITutorial

Then  the TurbineResource.getString("java.naming.security.principal")
couldn't return String.
I would like to get "cn=Manager, o=JNDITutorial" as a String but it returns
a Object.

As a temporary solution, I modified the getString() method in
Configurations.java like

    public String getString(String key, String defaultValue) {
        Object value = repository.get(key);
        if (value instanceof String) {
            return (String) value;
        } else if (value == null) {
            if (defaults != null) {
                return defaults.getString(key, defaultValue);
            } else {
                return defaultValue;
            }
        } else {
                String str = value.toString();
                return str.substring(1,str.length() - 1);
            // throw new ClassCastException(key  + " doesn't map to a String
object");
        }
    }

It works good, but it is a temporary solution I think.

How can I solve this problem without any breaking of compatibility in
Turbine package.


Thanks in advance.

youngho



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to