code: def set_user_application_data_directory(directory):
      
  
      LOGGER.debug("> Current Application data directory '{0}'.".format(directory))
      if foundations.io.set_directory(directory):
          for sub_directory in Constants.preferences_directories:
              if not foundations.io.set_directory(os.path.join(directory, sub_directory)):
                  raise OSError("{0} | '{1}' directory creation failed , '{2}' will now close!".format(
                      __name__, os.path.join(directory, sub_directory), Constants.application_name))
          return True
      else:
          raise OSError("{0} | '{1}' directory creation failed , '{2}' will now close!".format(__name__,
                                                                                               directory,
                                                                                               Constants.application_name))
docs: Sets the user Application data directory.
  
      :param directory: Starting point for the directories tree creation.
      :type directory: unicode
      :return: Definition success.
      :rtype: bool