Directory Listing in Rhino

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:

http://snipplr.com/js/embed.jshttp://snipplr.com/json/63696

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s