JAVA 中如何得到文件路径 1
如何获得当前文件路径 常用: 字符串类型:System
getProperty("user
dir"); 综合: package com
base; import java
File; public class Test { public static void main(String[] args) throws Exception { System
println( Thread
currentThread()
getContextClassLoader ()
getResource("")); System
println(Test
getClassLoader ()
getResource("")); System
println(ClassLoader
getSystemResource("")); System
println(Test
getResource("")); System
println(Test
getResource("/")); System
println(new File("")
getAbsolutePath()); System
println(System
getProperty("user
dir")); } } 2
Web 服务中 (1)
Weblogic WebApplication 的系统文件根目录是你的weblogic 安装所在根目录
例如:如果你的weblogic 安装在c:\bea\weblogic700
那么,你的文件根路径就是c:\
所以,有两种方式能够让你访问你的服务器端的文件: a
使用绝对路径: 比如将你的参数文件放在c:\yourconfig\