InputStream is = getClass().getClassLoader().getResourceAsStream("file.txt");
ClassPathResource resource = new ClassPathResource("fileName");
InputStream inputStream = resource.getInputStream();
ClassPathResource resource = new ClassPathResource("fileName");
InputStream inputStream = resource.getInputStream();