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

📄 version.java

📁 linux 网络监控 。主要是对Linux系统的网络数据进行监控。
💻 JAVA
字号:
package pub.ver;


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

import pub.log.LogOutPut;

/**
 * 自动化版本管理类。是版本的控制和说明文件。
 * @time 2009-3-19.
 * @author zhengguohua
 * @version	1.0
 * @since		JDK1.6(建议)
 */

public class Version {


    private static String sVersion;

    private static String sSystemVersion;
    
    private static String sCopyright;

    public static void main(String[] args) {
        if(args==null||args.length<=0||args[0].equalsIgnoreCase("-v")) {
        	LogOutPut.getInstance().info(getSystemInfo());
        	LogOutPut.getInstance().info(getVersion());
        } else {
        	LogOutPut.getInstance().info("-v  SystemVersion.\n-iv  InnerVersion.");
        }
        System.exit(0);
    }


    public static String getVersion() {
        if (sVersion == null) {
            try {
                String resource = "version.properties";
                InputStream in = Version.class.getResourceAsStream(resource);
                Properties properties = new Properties();
                properties.load(in);

                sVersion =
                    properties.getProperty("dms.version", "Unknown");
            } catch (Exception e) {
                sVersion = "Unknown";
            }
        }
        return sVersion;
    }


    public static String getSystemInfo() {
        if (sSystemVersion == null) {
            try {
                String resource = "version.properties";
                InputStream in = Version.class.getResourceAsStream(resource);
                Properties properties = new Properties();
                properties.load(in);

                sSystemVersion = properties.getProperty("system.info");
            } catch (Exception e) {
                sSystemVersion = "Unknown";
            }
        }
        return sSystemVersion;
    }
    
    public static String getCopyright() {
        if (sCopyright == null) {
            try {
                String resource = "version.properties";
                InputStream in = Version.class.getResourceAsStream(resource);
                Properties properties = new Properties();
                properties.load(in);

                sCopyright = properties.getProperty("system.copyright");
            } catch (Exception e) {
            	sCopyright = "Unknown";
            }
        }
        return sCopyright;
    }
    
}

⌨️ 快捷键说明

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