def _check_spatial_resource(self, url, name, dictionary, update=False):
        """ 
        This method will check geoserver for the existence of an object.
        It will create the object if it doesn't exist.

        @param url: The URL of the resource.
        @param name: The name of the resource.
        @param dictionary: A dictionary of settings to the resource.
        @keyword type_name: Optional. Name of the type, if different from the name.
        @keyword update: Optional. Update the featuretype if it exists?
        @returns: A flag indicating if the configuration call completed successfully.
        """
        if self._rest_check('%s/%s.json' % (url, name)):
            if update:
                if not self._rest_config( 'PUT', url, data=json.dumps(dictionary)):
                    return False
                
        else:
            if not self._rest_config( 'POST', url, data=json.dumps(dictionary)):
                return False

        return True
dataset/ETHPy150Open PublicMapping/DistrictBuilder/django/publicmapping/redistricting/config.py/SpatialUtils._check_spatial_resource/original