Originally taken from https://wrapper.svn.sourceforge.net/svnroot/wrapper/tags/RELEASE_3_2_3/wrapper/