判断项目部署环境window And linux

2020-11-20  本文已影响0人  吴繁飞
public static boolean isLinux() {
        return System.getProperty("os.name").toLowerCase().contains("linux");
    }
 
    public static boolean isWindows() {
        return System.getProperty("os.name").toLowerCase().contains("windows");
    }
uploadSealFile_LinuxPath=/home/file/sealFile
uploadSealFile_WindowsPath=E:/home/file/sealFile

if(AppCommonUtils.isLinux()){
            realFilePath = properties.getProperty("uploadSealFile_LinuxPath") + "/" + realFileName;
}else if(AppCommonUtils.isWindows()){
            realFilePath = properties.getProperty("uploadSealFile_WindowsPath") + "/" + realFileName;
        }
上一篇下一篇

猜你喜欢

热点阅读