I having file in the location
--src
--> main
--> config
--> application
--> context
--> reference
--> user
--> user.xml
where
--src
--> main
--> config
is in the classpath. Now I am trying to access the file using
Resource resource = new ClassPathResource("classpath**:/application/context/references/user/user.xml");
File file = resource.getFile();
But I getting FileNotFoundException
, I tried with
Resource resource = new ClassPathResource("classpath:/application/context/references/user/user.xml");
File file = resource.getFile();
too, but still I getting the exception. Can someone help me to understand the working of ClassPathResource
and right solution?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…