'Gets or creates a Folder based the list of folder names in hierarchical
order (like breadcrumbs).
get_or_create_folder([\'root\', \'subfolder\', \'subsub folder\'])
creates the folders with correct parent relations and returns the
\'subsub folder\' instance.'

def get_or_create_folder(self, folder_names):

    if (not len(folder_names)):
        return None
    current_parent = None
    for folder_name in folder_names:
        (current_parent, created) = Folder.objects.get_or_create(name=folder_name, parent=current_parent)
        if created:
            self.folder_created += 1
            if (self.verbosity >= 2):
                print (u'folder_created    #%s    folder    :    %s    --    created    :    %s' % (self.folder_created, current_parent, created))
    return current_parent
