测试代码
package cn.edu.hdu.pichen.springexample;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.List;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.util.StringUtils;
import cn.edu.hdu.pichen.springexample.beans.User;
/**
* Hello world!
*
*/
public class App
{
public static void main(String[] args) throws IOException
{
// ClassPathResource resource = new
// ClassPathResource("./../classes/beans.xml");
// System.out.println(resource.getPath());
// System.out.println(resource.getDescription());
// System.out.println(resource.getURL().getPath());
//
// InputStream is = resource.getInputStream();
// BufferedReader br = new BufferedReader(new InputStreamReader(is));
// String str = br.readLine();
// while (str != null)
// {
// System.out.println(str);
// str = br.readLine();
// }
//
System.out.println(StringUtils.cleanPath(".\\beans.xml")); // \\替换为/
System.out.println(StringUtils.cleanPath("file:core/../core/./io/Resource.class"));
// System.out.println(StringUtils.cleanPath("./../../beans.xml"));
// System.out.println(StringUtils.cleanPat