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多少次