Asterisk - java, Manager API, get rid of a blank line

Hi All,
I have been using Asterisk-java Manager API to modify the configuration files in Asterisk server. I can successfully add/delete lines from the configuration file. However, when i delete a line, there is a blank line which remains and does not get removed. Does anyone know how can I get rid of the blank line.

Thanks in advance!