using apache commons lang to remove the trailing separator.