摘要:
1, TestPath().class.getResource("").getPath()或TestPath().class.getResource("").getFile()获得的路径,不能被FileReader()和FileWriter()直接应用。 原因是URL对空格,特殊字符(%,#,[]等)和中文进行了编码处理。 例如:空格变为%20。 解决方法(1),使用repaceAll("%20",' ')替换后,只能解决空格问题。但是路径中包含%和中文就不行了。 解决方法(2),使用URLDecoder.decode 阅读全文
posted @ 2012-03-29 16:45
hold住
阅读(725)
评论(0)
推荐(0)

浙公网安备 33010602011771号