1 package com.mvnforum.db.ldap; 2 3 import java.io.FileInputStream ; 4 import java.io.FileNotFoundException ; 5 import java.io.IOException ; 6 import java.util.Properties ; 7 8 import net.myvietnam.mvncore.util.FileUtil; 9 10 public class LDAPConfig { 11 12 public static String PROVIDER_URL; 13 public static String INITIAL_CONTEXT_FACTORY; 14 public static String SECURITY_AUTHENTICATION; 15 public static String SECURITY_PRINCIPAL; 16 public static String SECURITY_CREDENTIALS; 17 18 static { 19 Properties prop = new Properties (); 20 try { 21 prop.load(new FileInputStream (FileUtil.getServletClassesPath() + "/LDAPConfig.properties")); 22 } catch (FileNotFoundException e) { 23 e.printStackTrace(); 24 } catch (IOException e) { 25 e.printStackTrace(); 26 } 27 28 PROVIDER_URL = prop.getProperty("provider_url"); 29 INITIAL_CONTEXT_FACTORY = prop.getProperty("initial_context_factory"); 30 SECURITY_AUTHENTICATION = prop.getProperty("security_authentication"); 31 SECURITY_PRINCIPAL = prop.getProperty("security_principal"); 32 SECURITY_CREDENTIALS = prop.getProperty("security_credentials"); 33 } 34 35 } 36 | Popular Tags |