Actually I never wrote my own filters and in your case it's not needed to write
your own filter because you can use the predefined WildcardFilter from
commons.io lib.
Just add the dependency to your su's pom.xml and have something like the
below:
<f:poller
service="my:filePoller"
endpoint="pollerEndpoint"
autoCreateDirectory="true"
file="/home/user/myinput/"
targetService="..."
targetOperation="..."
period="10000"
recursive="true">
<property name="filter">
<bean class="org.apache.commons.io.filefilter.WildcardFilter">
<constructor-arg value="*.xml" />
</bean>
</property>
</f:poller>
Lars
Am Dienstag 23 September 2008 14:50:16 schrieb steff aka sid:
> No, thats not enough :) you have to read the contents of the directory and
> to check them e.g. with pathname.listFiles() The problem is that it is not
> possible. To get a result for each file... but I will try it maybe it works
> as asspected.
>
> Regards
> /Steffen
>
> lhe77 wrote:
> > public class XMLFilter implements FileFilter {
> >
> > public static String XML_FILEEXTENSION = ".xml";
> >
> > public boolean accept(File pathname) {
> >
> > if (pathname.isDirectory() ||
> > (pathname.isFile() &&
> > strFilename.endsWith(XML_FILEEXTENSION))
> > ) {
> > return true;
> > }
> > return false;
> > }
> > }
> >
> > should do the trick.
> >
> > Lars
> >
> > Am Dienstag 23 September 2008 14:38:13 schrieb steff aka sid:
> >> public class XMLFilter implements FileFilter {
> >>
> >> public static String XML_FILEEXTENSION = ".xml";
> >>
> >> public boolean accept(File pathname) {
> >> System.out.println(pathname);
> >> String strFilename = pathname.getName();
> >> if (strFilename.endsWith(XML_FILEEXTENSION)) {
> >> return true;
> >> }
> >> return false;
> >> }
> >> }
>
> -----
> Brockhaus GmbH
> COMPETITIVE THROUGH KNOWLEDGE
>
> Web: http://www.brockhaus-gruppe.de www.brockhaus-gruppe.de /
> http://www.brockhaus-group.com www.brockhaus-group.com