Code example for Properties

Methods: put

0
     * 
     * @return 
     */ 
    public Hashtable getEnvironment()
    { 
        Properties env = new Properties();
 
        env.put(Context.INITIAL_CONTEXT_FACTORY, _contextFactory);
 
        if (_hostname != null)
        { 
            env.put(Context.PROVIDER_URL, (_useLdaps?"ldaps://":"ldap://") + _hostname + (_port==0?"":":"+_port) +"/");
        } 
 
        if (_authenticationMethod != null)
        { 
            env.put(Context.SECURITY_AUTHENTICATION, _authenticationMethod);
        } 
 
        if (_bindDn != null)
        { 
            env.put(Context.SECURITY_PRINCIPAL, _bindDn);
        } 
 
        if (_bindPassword != null)
        { 
            env.put(Context.SECURITY_CREDENTIALS, _bindPassword);
        } 
 
        return env;
    }