@Component public class ResourceReaderImpl extends Object implements ResourceReader
ClassPathResource.
Handles the case where the Resource is a file within a Jar.
Reads the file as UTF-8.
String fileContent
= new ResourceReader()
.read(new ClassPathResource(filename));
| Constructor and Description |
|---|
ResourceReaderImpl() |
| Modifier and Type | Method and Description |
|---|---|
String |
read(org.springframework.core.io.Resource resource)
Reads the
Resource into a String. |
public String read(org.springframework.core.io.Resource resource) throws IOException
ResourceReaderResource into a String.read in interface ResourceReaderresource - the Resource to readResourceIOException - if Resource is not found or can't be opened or readCopyright © 2015. All rights reserved.