In one line try this to read test.xml:
String msg = StreamUtils.copyToString( new ClassPathResource("test.xml").getInputStream(), Charset.defaultCharset() );
More Related Contents:
- How to use JNDI DataSource provided by Tomcat in Spring?
- Configuring Spring Security 3.x to have multiple entry points
- After Spring Boot 2.0 migration: jdbcUrl is required with driverClassName
- How to change Spring’s @Scheduled fixedDelay at runtime?
- Redirect in Spring MVC
- Spring cron vs normal cron?
- Spring Data JPA find by embedded object property
- Table ‘DBNAME.hibernate_sequence’ doesn’t exist
- Spring Data JPA findOne() change to Optional how to use this?
- Spring’s @RequestParam with Enum
- Spring JUnit: How to Mock autowired component in autowired component
- PageRequest constructors have been deprecated
- What is the issue with the runtime discovery algorithm of Apache Commons Logging
- Required Multiple beans of same type in Spring
- Spring, JPA, and Hibernate – how to increment a counter without concurrency issues
- Filtering out log4j messages from third-party frameworks?
- Add SoapHeader to org.springframework.ws.WebServiceMessage
- How to setup Hibernate to read/write to different datasources?
- Spring REST security – Secure different URLs differently
- hibernate unique key validation
- Trying to create REST-ful URLs with multiple dots in the “filename” part – Spring 3.0 MVC
- difference between @Component and @Configuration in Spring 3
- Programmatically restart Spring Boot application / Refresh Spring Context
- What does Cookie CsrfTokenRepository.withHttpOnlyFalse () do and when to use it?
- How to auto detect entities in JPA 2.0
- Spring: circular dependencies, @PostConstruct and order imposed by @DependsOn
- disabling spring security in spring boot app [duplicate]
- Could not initialize proxy – no Session
- Custom Authentication Manager with Spring Security and Java Configuration
- How to implement @RequestMapping custom properties