title: Can FreeMarker write contents of directory to a template?
body: <p>I'm trying to figure out how to use FreeMarker to generate a file like so:</p>
  
  <pre><code>The contents of /home/myuser/somedir are:
      blah.txt
      fizz.gif
      buzz.jpg
      widget.log
  </code></pre>
  
  <p>...from a template like so:</p>
  
  <pre><code>The contents of &lt;%dir%&gt; are:
      &lt;%contents%&gt;
  </code></pre>
  
  <p>I read the excellent Vogella tutorial on FreeMarker, but not really sure how to put this all together: once I query the directory for its contents, how do I add each item to this list of <code>&lt;%contents%&gt;</code>? Thanks in advance!</p>