Can MD5ing all the files in a table cause a memory leak?
In Java you have to do so much hard work to leak memory (someone will say not closing stream, but that's another story). 

I think you have a C programming background. So you are thinking of memory leak. Forget it there is JVM for you.

And use enhanced for loop in Java as much as you can...

for(File file : directory) {
    System.out.println(MD5.asHex(MD5.getHash(file)));
}