something wierd with ioutils, so went back to native java.