this.class.getProtectionDomain().getCodeSource().getLocation()
来源:互联网 发布:淘宝美工助手破解版 编辑:程序博客网 时间:2024/04/29 16:09
this.class.getProtectionDomain().getCodeSource().getLocation()
如果直接执行.class文件那么会得到当前class的绝对路径。
如果封装在jar包里面执行jar包那么会得到当前jar包的绝对路径。
String path = getClass().getProtectionDomain().getCodeSource().getLocation().getPath();
这句话取到的路径是 服务器 中的发布版本的路径。
阅读全文
0 0
- this.class.getProtectionDomain().getCodeSource().getLocation()
- Class.this与this
- GetLocation 位置定位
- this.class.getClassLoader()
- this.class.getClassLoader().getResourceAsStream
- this.class.getClassLoader().getResourceAsStream
- this.class.getClassLoader().getResourceAsStream
- this.class.getClassLoader().getResourceAsStream
- this的用法(class.this)
- this.class.getClassLoader().getResourceAsStream与this.class.getResourceAsStream
- this.class.getClassLoader()怎么理解?
- this.class.getClassLoader()怎么理解?
- synchronized(this)与synchronized(class)
- this.class.getClassLoader()怎么理解?
- this.class.getClassLoader()怎么理解?
- this.class.getClassLoader()怎么理解?
- this.class.getClassLoader()怎么理解?
- this.class.getClassLoader()怎么理解?
- css3贝塞尔曲线
- Java向上转型和向下转型
- Python的一些总结
- java中把查询出来的结果进行分页
- linux命令大全(2)
- this.class.getProtectionDomain().getCodeSource().getLocation()
- CodeForces 277A Learning Languages (并查集)
- 游戏开发之UGUI工具类
- ems-build.sh
- 禁止ScrollView内的控件改变之后自动滚动
- spring 拦截器
- codility Distinct
- 学习笔记之浅谈面向对象编程2(类,对象)
- <C++>C++源文件包含C源文件(C++中如何使用C)