Preserve permissions in directory producer

I've starting using the awesome lib for ant a couple of weeks ago. But if I not wrong, the most simple usage is not supported:

I want to preserve the permissions of the files in my directory, and override the user to root as usual in any installed app... I've tried to do this in a easy way but for me was absolutely impossible... I've added some changes to preserve the permissions...

WARNING: requires jdk1.7