public class Test1110 { public static void main(String[] args) throws IOException { ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); org.springframework.core.io.Resource[] resources = resolver.getResources("classpath:img/logo.jpg"); org.springframework.core.io.Resource resource = resources[0]; System.out.println("getDescription: "+resource.getDescription()); //class path resource [img/logo.jpg] System.out.println("getFilename: "+resource.getFilename()); //logo.jpg } }