赞
踩
String home = System.getProperty("user.home");
File f = new File(home + File.separator + "Documents" + File.separator + "test" + File.separator" + "java.txt");
或者使用org.apache.commons.io.FilenameUtils.normalize:
File f = new File(FileNameUtils.normalize(home + "/Documents/test/java.txt"));
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。