All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.winroad.wrdoclet.utils.ApplicationContextConfig Maven / Gradle / Ivy

The newest version!
package net.winroad.wrdoclet.utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ApplicationContextConfig {
	static private String stopClasses = null;
	
	static {
		loadConfigFile();
	}

	synchronized static public void loadConfigFile() {
		if (stopClasses == null) {
			InputStream is = ApplicationContextConfig.class
					.getResourceAsStream("/wrdoclet.properties");
			Properties props = new Properties();
			try {
				props.load(is);
				stopClasses = props.getProperty("stop.classes");
			} catch (Exception e) {
				LoggerFactory.getLogger(ApplicationContextConfig.class).error(
						"不能读取属性文件. "
						+ "请确保wrdoclet.properties在CLASSPATH指定的路径中");
			} finally {
				try {
					is.close();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
	}
	
	public static String getStopClasses() {
		if (stopClasses == null) {
			loadConfigFile();
		}
		return stopClasses;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy