This is pretty simple, but I couldn’t find it via searching, so I thought a little write up was in order.
I’m fooling around with Rhino, which is a JavaScript engine written in Java. It allows you to do a lot, but in my case I am using it to write JavaScript helper scripts for ANT. I’m working on a project for which I want to only write in HMTL/JavaScript/CSS. I have to write some ANT scripts, but anything that I can’t accomplish with ANT, which means I need a scripting language to do, I decided to do in JavaScript. Rhino allows me to accomplish that.
I’ll post more about what I’m trying to do when I release more about the project. For this step, I needed to get a list of all of my files in my project so I could manipulate them in JavaScript. I looked for a directoryList function, but only found this post on Directory Traversal. So I whipped up my own script for DirectoryList in JavaScript using Java on Rhino: