<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Java version of CFDIRECTORY</title>
	<atom:link href="http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/</link>
	<description>My thoughts on ColdFusion, Flex and other RIA stuff....</description>
	<lastBuildDate>Tue, 07 Feb 2012 10:21:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: Stillnet Studios &#187; Blog Archive &#187; Fast alternative to cfdirectory for large file lists</title>
		<link>http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/comment-page-1/#comment-2901</link>
		<dc:creator>Stillnet Studios &#187; Blog Archive &#187; Fast alternative to cfdirectory for large file lists</dc:creator>
		<pubDate>Fri, 08 Aug 2008 16:06:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/#comment-2901</guid>
		<description>[...] is a stripped down version of Anuj Gakhar&#8217;s version of this function, his does recursion and returns even more data than cfdirectory [...]</description>
		<content:encoded><![CDATA[<p>[...] is a stripped down version of Anuj Gakhar&#8217;s version of this function, his does recursion and returns even more data than cfdirectory [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anuj Gakhar</title>
		<link>http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/comment-page-1/#comment-61</link>
		<dc:creator>Anuj Gakhar</dc:creator>
		<pubDate>Thu, 08 Nov 2007 15:17:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/#comment-61</guid>
		<description>Thanks Marc. I think I was not being clear. I know we can do a CFC or a UDF or a CFX to do the same stuff as FileFilter in Java but this whole exercise was just to see if I could do it via creating java objects within CF code. But anyways, thanks for your suggestions. I think if its to be done  without involving Coldfusion code, it should be done in a java class file like you said earlier.....</description>
		<content:encoded><![CDATA[<p>Thanks Marc. I think I was not being clear. I know we can do a CFC or a UDF or a CFX to do the same stuff as FileFilter in Java but this whole exercise was just to see if I could do it via creating java objects within CF code. But anyways, thanks for your suggestions. I think if its to be done  without involving Coldfusion code, it should be done in a java class file like you said earlier&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marc Esher</title>
		<link>http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/comment-page-1/#comment-60</link>
		<dc:creator>Marc Esher</dc:creator>
		<pubDate>Thu, 08 Nov 2007 15:02:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/#comment-60</guid>
		<description>Now, if you just wanted the ability to do the same filtering that&#039;s in cfdirectory already, i.e. simple name-based file filtering, well, that&#039;s pretty simple. potentially slow on a large directory, but you could do it one of two ways:

1) do a simple query of query after you create your directory query
2) simple IF statement in your loop

However, you could still get around the problem by implementing your own FileFilter CFC, mimicing the java version (i.e. a single method...accept()) that takes file objects.

you couldn&#039;t pass it to the java listFiles call, but you could use it yourself in your own code, i.e.:

if(arguments.FileFilter.accept(oFile){
   ... do all your query new row stuff.
}


  
    
      .... date stuff in java
                 

&lt;/cfcomponent</description>
		<content:encoded><![CDATA[<p>Now, if you just wanted the ability to do the same filtering that&#8217;s in cfdirectory already, i.e. simple name-based file filtering, well, that&#8217;s pretty simple. potentially slow on a large directory, but you could do it one of two ways:</p>
<p>1) do a simple query of query after you create your directory query<br />
2) simple IF statement in your loop</p>
<p>However, you could still get around the problem by implementing your own FileFilter CFC, mimicing the java version (i.e. a single method&#8230;accept()) that takes file objects.</p>
<p>you couldn&#8217;t pass it to the java listFiles call, but you could use it yourself in your own code, i.e.:</p>
<p>if(arguments.FileFilter.accept(oFile){<br />
   &#8230; do all your query new row stuff.<br />
}</p>
<p>      &#8230;. date stuff in java</p>
<p>&lt;/cfcomponent</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anuj Gakhar</title>
		<link>http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/comment-page-1/#comment-59</link>
		<dc:creator>Anuj Gakhar</dc:creator>
		<pubDate>Thu, 08 Nov 2007 14:47:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/#comment-59</guid>
		<description>Thanks Marc for this , that is interesting. I could put it all in a CFX and add a lot of other features but here in particular I was trying to do it via CreateObject() in CF itself. I assume that cant be done unless we create custon java classes like you did.</description>
		<content:encoded><![CDATA[<p>Thanks Marc for this , that is interesting. I could put it all in a CFX and add a lot of other features but here in particular I was trying to do it via CreateObject() in CF itself. I assume that cant be done unless we create custon java classes like you did.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marc Esher</title>
		<link>http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/comment-page-1/#comment-58</link>
		<dc:creator>Marc Esher</dc:creator>
		<pubDate>Thu, 08 Nov 2007 14:42:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/#comment-58</guid>
		<description>here&#039;s a super simple filter i whipped up real quick a long time ago. you could drop it in your cf install&#039;s classes directory then restart, then use MyFilter = createObject(&quot;java&quot;,&quot;xxx.BeforeDateFilter&quot;).

there is also something on cflib.org for dynamic classloading if you didn&#039;t want to deal with a server restart.

package XXX;

import java.io.File;
import java.io.FileFilter;
import java.util.Date;

public class BeforeDateFilter implements FileFilter {
    long threshold;    
    public BeforeDateFilter(Date thresholdDate){
        threshold = thresholdDate.getTime();
    }
    public boolean accept(File file) {
        return file.lastModified() &lt; threshold;
    }
}</description>
		<content:encoded><![CDATA[<p>here&#8217;s a super simple filter i whipped up real quick a long time ago. you could drop it in your cf install&#8217;s classes directory then restart, then use MyFilter = createObject(&#8220;java&#8221;,&#8221;xxx.BeforeDateFilter&#8221;).</p>
<p>there is also something on cflib.org for dynamic classloading if you didn&#8217;t want to deal with a server restart.</p>
<p>package XXX;</p>
<p>import java.io.File;<br />
import java.io.FileFilter;<br />
import java.util.Date;</p>
<p>public class BeforeDateFilter implements FileFilter {<br />
    long threshold;<br />
    public BeforeDateFilter(Date thresholdDate){<br />
        threshold = thresholdDate.getTime();<br />
    }<br />
    public boolean accept(File file) {<br />
        return file.lastModified() &lt; threshold;<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anuj Gakhar</title>
		<link>http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/comment-page-1/#comment-57</link>
		<dc:creator>Anuj Gakhar</dc:creator>
		<pubDate>Thu, 08 Nov 2007 14:28:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/#comment-57</guid>
		<description>Qasim, I tried using FileFilter but I think like you said, as its an Interface and not a class, its not possible to use it or atleast i couldnt do it.....may be someone else knows how to ?</description>
		<content:encoded><![CDATA[<p>Qasim, I tried using FileFilter but I think like you said, as its an Interface and not a class, its not possible to use it or atleast i couldnt do it&#8230;..may be someone else knows how to ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Java version of CFDIRECTORY: Updated &#124; Coldfusion/Flex Development</title>
		<link>http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/comment-page-1/#comment-54</link>
		<dc:creator>Java version of CFDIRECTORY: Updated &#124; Coldfusion/Flex Development</dc:creator>
		<pubDate>Thu, 08 Nov 2007 10:05:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/#comment-54</guid>
		<description>[...] original post on this subject got some improvements and suggestions from different people. So I decided to put [...]</description>
		<content:encoded><![CDATA[<p>[...] original post on this subject got some improvements and suggestions from different people. So I decided to put [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anuj Gakhar</title>
		<link>http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/comment-page-1/#comment-53</link>
		<dc:creator>Anuj Gakhar</dc:creator>
		<pubDate>Thu, 08 Nov 2007 06:31:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/#comment-53</guid>
		<description>Thanks Qasim, I am sure my first attempt was the same as what you&#039;ve done but for some reason I was getting an error which is why I decided to do another CreateObject while inside the loop. But good to see that it works this way. 
Cheers!</description>
		<content:encoded><![CDATA[<p>Thanks Qasim, I am sure my first attempt was the same as what you&#8217;ve done but for some reason I was getting an error which is why I decided to do another CreateObject while inside the loop. But good to see that it works this way.<br />
Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Qasim Rasheed</title>
		<link>http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/comment-page-1/#comment-52</link>
		<dc:creator>Qasim Rasheed</dc:creator>
		<pubDate>Wed, 07 Nov 2007 22:28:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/#comment-52</guid>
		<description>Anuj,

I&#039;ve simplified this function as you can easily get an Array of file objects directly from the Files Class. 

http://cfm.pastebin.com/m7a4828ca

However I didn&#039;t do any performance metrics by comparing it with your earlier version. Let me know if you are able to find a way to apply FileFilter which is an interface. 

Thanks</description>
		<content:encoded><![CDATA[<p>Anuj,</p>
<p>I&#8217;ve simplified this function as you can easily get an Array of file objects directly from the Files Class. </p>
<p><a href="http://cfm.pastebin.com/m7a4828ca" rel="nofollow">http://cfm.pastebin.com/m7a4828ca</a></p>
<p>However I didn&#8217;t do any performance metrics by comparing it with your earlier version. Let me know if you are able to find a way to apply FileFilter which is an interface. </p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anuj Gakhar</title>
		<link>http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/comment-page-1/#comment-38</link>
		<dc:creator>Anuj Gakhar</dc:creator>
		<pubDate>Wed, 07 Nov 2007 13:30:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2007/11/06/java-version-of-cfdirectory/#comment-38</guid>
		<description>I used CFTIMER to find out the processing times.</description>
		<content:encoded><![CDATA[<p>I used CFTIMER to find out the processing times.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

