Skip to content

Support injecting resource as Reader [SPR-12876] #17474

@spring-projects-issues

Description

@spring-projects-issues

Christopher Smith opened SPR-12876 and commented

I am using the ability to inject an InputStream from the classpath, a la

@Autowired
MyConstructor(@Value('classpath:foo.csv') InputStream csv)

It would be convenient to be able to work with the resource as a Reader instead of an InputStream, but Spring doesn't know how to translate the string value into a Reader. Would it be feasible to have the conversion system understand how to wrap an InputStreamReader around the injected resource?


Affects: 4.1.5

Referenced from: commits 2c637dc

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions