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

📄 env.java

📁 pk_Total - 相同msg_Id消息总条数 pk_Number - 相同msg_Id的消息序号 registered_Delivery - 是否要求返回状态报告 msg_Level - 信
💻 JAVA
字号:
package demo.smppdemo ;

import java.io.File ;
import java.io.IOException ;

import com.huawei.smproxy.util.Cfg ;
import com.huawei.smproxy.util.Debug ;
import com.huawei.smproxy.util.Resource ;

/**
 * A iuniform external interface for parsing the configuration file and resource file.
 */
public class Env
{
	/**
	 * Cfg class is used for reading and writting the configuration file.
	 */
    static Cfg config ;

	/**
	 * Resource class is used for reading and writting the resource file in smpp package.
	 */
	static Resource resource ;

	/**
	 * Gets a instance of Cfg class contained the connection infomation.
	 * @return Cfg
	 */
    public static Cfg getConfig ()
    {
		if (config==null)
		{// Not be initialized.
			try
			{
				config = new Cfg("config.xml");
			}
			catch (IOException ex)
			{
				Debug.dump(
					"reading config file error,pealse make sure the config.xml"
					+" is in the correct path !");
			}
		}

		return config;
	}

	/**
	  * Gets a instance of Resource class.
	  * The resource file 'resource' is used by english users.
	  * The resource file 'resource_zh' is used by chinese users.
	  * @return Resource
	  */
    public static Resource getResource ()
    {
	if ( resource == null )
	{
	    try
	    {
		resource = new Resource ( "resource" ) ;
	    }
	    catch ( IOException ex )
	    {
		Debug.dump (
			"reading resource file error,pealse make sure the resource(resource_en).xml"
			+ " is in the correct path !" ) ;
	    }
	}
	return resource ;
    }
}

⌨️ 快捷键说明

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