':param extension: The new extension to set, without the \'.\'
:return: None. The extension is set. An exception is raised if the
original URL had no extension.'

@set_changed
def set_extension(self, extension):

    if (not self.get_extension()):
        raise Exception('You    can    only    set    a    new    extension    to    a    URL    that    had    one.')
    filename = self.get_file_name()
    split_filename = filename.split('.')
    split_filename[(-1)] = extension
    new_filename = '.'.join(split_filename)
    self.set_file_name(new_filename)
