⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 systemconfigdata.java

📁 本代码是一个权限管理系统源代码
💻 JAVA
字号:

/*
 * Created on 2007-4-30
 *
 * 
 * 
 */
 package com.seavision.PermissionManage.help;

import java.io.UnsupportedEncodingException;
import java.util.ResourceBundle;


/**
 * @author Administrator
 *
 * 
 * 
 */
public class SystemConfigData {

	private static String configFileName = "seavisionconfig";

	private static ResourceBundle bundle = null;

	static {
		try {

			bundle = ResourceBundle.getBundle(configFileName);

		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("没有找到配置文件:" + configFileName);
		}
	}

	public static String getConfig(String configName) {
		try {

			if (null != bundle && null != configName) {
				return bundle.getString(configName);
			} else {
				System.out.println("没有找到配置:" + configName);
				return null;
			}

		} catch (java.util.MissingResourceException e) {
			System.out.println("没有找到配置:" + configName);
			return null;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}

	}
	
	public static String getConfigGBK(String configName){
		String   strGBK   = "";
		try {
			String a = getConfig(configName);
			if(a != null && a.length() > 0)
				strGBK = new String(a.getBytes("iso-8859-1"),"GBK");
			
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		return strGBK;
		
	}
	public static Integer getConfigInteger(String configName) {
		String value = getConfig(configName);
		
		return new Integer(value);
	}

	public static Long getConfigLong(String configName) {
		String value = getConfig(configName);

		return new Long(value);
	}

	public static Object getObjectInstance(String configName) {
		String className = SystemConfigData.getConfig(configName);
		try {
			if(null != className)
			return Class.forName(className).newInstance();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		};
		return null;
	}
	
	public static void main(String[] a){
		

	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -