首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

java路径空格有关问题

2012-08-24 
java路径空格问题strTest.class.getResource(/).getPath()System.out.println(----+str)try {//str

java路径空格问题
str=Test.class.getResource("/").getPath();
System.out.println("----"+str);
try {
//str=URLEncoder.encode(str,"UTF-8");
System.out.println("----"+str);
str=URLDecoder.decode(URLDecoder.decode(str,"UTF-8"),"UTF-8");
System.out.println(str);
File file=new File(str);
System.out.println(file.isDirectory());
System.out.println(file.isFile());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}



encode多少次必须decode多少次

热点排行