我是靠谱客的博主 尊敬发箍,这篇文章主要介绍ssh获取webContent路径,现在分享给大家,希望可以做个参考。

ssh获取webContent路径:

String t=Thread.currentThread().getContextClassLoader().getResource("").getPath();
int num=t.indexOf(".metadata");
String path=t.substring(1,num).replace('/', '\')+"项目名\WebContent\文件名";

这里写图片描述

String t=Thread.currentThread().getContextClassLoader().getResource("").getPath();
int num=t.indexOf(".metadata");
String path=t.substring(1,num).replace('/', '\')+"SSH-Test\WebContent\file\CaculatorProcess.bpel";

java获取根路径:

 String relativePath = System.getProperty("user.dir"); 
String bpellocation = relativePath+"\file\BpelTest.bpel";

这里写图片描述

最后

以上就是尊敬发箍最近收集整理的关于ssh获取webContent路径的全部内容,更多相关ssh获取webContent路径内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(120)

评论列表共有 0 条评论

立即
投稿
返回
顶部