environment.java

来自「OBPM是一个开源」· Java 代码 · 共 58 行

JAVA
58
字号
package cn.myapps.constans;

/**
 * The environment variable.
 */
public class Environment {

	private String _wcpath;

	private String _contextPath;

	public Environment() {
		
	}
	
	
	public Environment(String wcpath) {
		setWebcontextBasePath(wcpath);
	}
	
	
	/**
	 * @param wcpath
	 *            The web context path.
	 */
	public void setWebcontextBasePath(String wcpath) {
		_wcpath = wcpath;
	}

	/**
	 * Retrieve the web context path.
	 * 
	 * @return The web context path.
	 */
	public String getWebcontextBasePath() {
		return (_wcpath != null) ? _wcpath : "/";
	}

	/**
	 * Retrieve the web context physicsal path.
	 * 
	 * @param path
	 *            The web path.
	 * @return The web context physicsal path.
	 */
	public String getWebcontextRealPath(String path) {
		return (path != null) ? getWebcontextBasePath() + path : null;
	}

	public String setContextPath(String cpath) {
		return _contextPath = cpath;
	}

	public String getContextPath() {
		return _contextPath;
	}
}

⌨️ 快捷键说明

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