From Java to Groovy

Recently I’ve been playing with some old Java Swing applications and I found myself wishing that I could replace all the anonymous inner-classes with some clean Groovy closures. The job of converting a java source file to a groovy source file is pretty simple and eminently scriptable. Here’s my take on a python script to do just that: from optparse import OptionParser from subprocess import Popen, PIPE import os def rename(src, dest, use_svn): if use_svn: output = Popen(['svn', 'rename', src, dest], stdout=PIPE)....

JUnit tests and the file system

Writing unit tests for classes that operate on files has always been a little weird. Every developer & their dog has their own way of either abstracting themselves from the file system (ala Spring’s Resource types) or by creating some sort of a file system sandbox that is cleaned up at the end of the test - after all we don’t want to litter temp directories with files that will never be used again, do we?...

Another example J2EE application

I've uploaded to GitHub (http://github.com/tomcz/pico-webapp/tree/master) the web application that I use to teach people about dependency injection (using PicoContainer), post-redirect-get browser interaction, RESTful URIs and strict template rendering (using StringTemplate). This application does not use Spring Framework by deliberate design - as soon as I introduce it to any teaching session I spend more time talking about Spring then talking about what I am usually there to accomplish. As usual, any comments, bugs or enhancement requests are very welcome....

Example J2EE application

I hate maven with an almost homicidal passion. It only works if your brain works like maven, for the rest of us in the real world its just a pain in the arse. But it does have one good idea - it provides a simple, out of the box way of creating a project structure (but so do rails, django and grails in a much better way). I've decided to publish my own example web application project/structure on GitHub - http://github....

S3DropBox 1.2 is now released

I love feedback ... including bugs (thanks Cam). The S3DropBox will now only permit the creation of a bucket when Amazon S3 returns a HTTP 404 status code in response to a HTTP HEAD request for the bucket prior to creation. The new version can now be downloaded from http://code.google.com/p/s3dropbox/....

JPasskeep Update

Just finished a new version of my long-running password keeper application. You can download the cross-platform version, the mac dmg image, and the source code. New changes include the ability to export entries to an encrypted HTML page (see my previous post on javascript cryptography) and bundling the cross-platform version as a single JAR file using one-jar. As usual this version does not rely on javax.crypto APIs to function so it should work wherever a JDK5 compatible VM can run....

Javascript Cryptography on the iPhone

How can I store my list of passwords on an iPhone or iPod Touch? This is the question that I attempted to solve as I geeked out over the weekend. I know I can buy an application like 1Password and sync between a laptop and an iPhone but I already have a pretty good password manager (since I wrote the one I use years ago). After a bit of research I came up with a few possibilities: create an iPhone app to sync with my password manager, create an encrypted bookmarklet (this is the way 1Password used to export passwords to the iPhone), or create a html page which will alter its own structure after I enter a password....

S3DropBox 1.1 has been released

This release now permits the S3DropBox to be used in corporate environments (ie. behind authenticated proxies), including being able to handle NTLM authentication with proxies. HTTPS support has been enabled, although HTTP is still used by default. Check out the new release here....

S3DropBox is now on Google Code

In June of 2008 I released the initial version of the S3DropBox as a download available from this blog (see S3DropBox). Since then I've been adding little enhancements to the drop box as updates to the linked zip files. This of course is not the right way to share an application or its code-base, so I've created a google code project at http://code.google.com/p/s3dropbox/. Feedback, patches and wish-list items are always welcome....

JCrawler rules

A year ago I wrote a post about about writing a program to performance test web applications (see Thumper). Since I finished off the original set of python scripts, I haven't really had the time to continue developing this application further in either Java, Ruby or any other language. Fortunately there is someone out there who thinks that threaded performance tools have an inherent flaw. Enter JCrawler ... go out and try it....