日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學(xué)無(wú)先后,達(dá)者為師

網(wǎng)站首頁(yè) 編程語(yǔ)言 正文

Springboot獲取jar包同級(jí)目錄

作者:提里奧丶弗丁 更新時(shí)間: 2023-07-18 編程語(yǔ)言
	public String getPath() {
		String path = this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath();
		if (System.getProperty("os.name").contains("dows")) {
			return path.substring(1).replace("target/classes/", "");
		}
		if (path.contains("jar")) {
			path = path.substring(0, path.lastIndexOf("."));
			path = path.substring(0, path.lastIndexOf("/")+1);
		}
		return path.substring(path.indexOf(":")+1);
	}

原文鏈接:https://blog.csdn.net/m0_65014849/article/details/131638173

  • 上一篇:沒(méi)有了
  • 下一篇:沒(méi)有了
欄目分類
最近更新