String path = Dom4jUtils.class.getClassLoader().getResource("users.xml").getPath();
//解决路径空格办法1
path = new URI(path).getPath();//import java.net.URI;
//解决路径空格的办法2,可以把中文路径的问题也一并解决
path = java.net.URLDecoder.decode(path,"utf-8");
System.out.println(new File(path));