While searching for existing files if directory separator is not correct then original files and directories will be deleted. So use DIRECTORY_SEPARATOR.