'This method is called before saving the option value to the profile file
Added when fixing:
https://github.com/andresriancho/w3af/issues/402
:return: A string representation of the path, with the ROOT_PATH
replaced with %ROOT_PATH%. Then when we load a value in
set_value we\'re going to replace the %ROOT_PATH% with ROOT_PATH
Something else we do here is to convert the temp file we
created during the base64:// data handler back to the base64://
string. This allows us to keep profiles which are
self-contained in that state.'

def get_value_for_profile(self, self_contained=False):

    if (self_contained or self.should_base64_encode_file(self._value)):
        try:
            return self.encode_b64_data(self._value)
        except Exception as e:
            msg = 'An    exception    occurred    while    encoding    "%s"    for    storing    into    the    profile:    "%s"'
            raise BaseFrameworkException((msg % (self._value, e)))
    abs_path = os.path.abspath(self._value)
    replaced_value = abs_path.replace(ROOT_PATH, ROOT_PATH_VAR)
    return replaced_value
