Getting a resource using application context?
Hi,
I have some jobs that run, using Spring's JobDetailBean. I need one of the jobs to read and write files, so I want to load them in using getResourceAsStream, but I am not sure how to provide the context to my JobClass.
Say, in my applicationContext.xml file, I have this:
Code:
<bean.....
<property name="jobDataAsMap">
<map>
<entry key="logFileLocation"><value>classpath:resources/logarchive.txt</value></entry>
....
Can I, in my code, somehow get that file, via the application context?
Code:
context = new StaticWebApplicationContext();
Resource r = context.getResource(logFileLocation);