xml - Get current resource name using MultiResourceItemReader Spring batch -


i using multiresourceitemreader in spring batch reading multiple xml files , want current resource.here configuration:

public class multifileresourcepartitioner extends multiresourceitemreader<myobject> {     @override     public void update(final executioncontext pexecutioncontext) throws itemstreamexception {         super.update(pexecutioncontext);         if (getcurrentresource() != null && getcurrentresource().getfilename() != null) {             system.out.println("update:" + getcurrentresource().getfilename());         }     } } 

and reader:

<bean id="mymultisourcereader"    class="mypackage.multifileresourcepartitioner">    <property name="resources" value="file:${input.directory}/*.xml" />  </bean> 

the code above read xml files correctly method getcurrentresources() return null. debugging, batch enter update method

please help!

there specific interface problem called resourceaware: it's purpouse inject current resource objects read multiresourceitemreader.
check this thread further information.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -