Provide ReST interface by mapping HTTP verb to class method
@return NULL
@param $url string
@param $class string|object
@param $ttl int
@param $kbps int
492360
function map($url,$class,$ttl=0,$kbps=0) {
		if (is_array($url)) {
			foreach ($url as $item)
				$this->map($item,$class,$ttl,$kbps);
			return;
		}
		foreach (explode('|',self::VERBS) as $method)
			$this->route($method.' '.$url,is_string($class)?
				$class.'->'.$this->hive['PREMAP'].strtolower($method):
				array($class,$this->hive['PREMAP'].strtolower($method)),
				$ttl,$kbps);
	}
856852
public function set($key, $value, $ttl = null)
    {
        return $this->driver->set($key, serialize($value), $ttl);
    }
676745
protected function getUrlPattern($class = null)
    {
        $url       = '';
        $classname = is_null($class) ? $this->model->owner_type : $class;
        if (!class_exists($classname)) {
            return $url;
        }
        if ($this->hasMethod($classname, 'getPatternUrl')) {
            $url = $classname::getPatternUrl($this->model->owner_id, $this->model);
        }
        return $url;
    }
729920
public function getResponseObject(string $class, string $json)
    {
        $object = $this->deserialize($class, $json);
        $this->assertValid($object, ValidationException::RESPONSE);

        return $object;
    }
323317
public function wrap($object, $id = null, $ttl = null)
    {
        $id = $id ?: get_class($object);
        return new ObjectWrapper($object, $this->ns($id, $ttl));
    }
956735
private BTreeKeySerializer<?> getBTreeKeySerializerFromClass(Class<?> klass) {
        if(klass == Integer.class) {
            return BTreeKeySerializer.ZERO_OR_POSITIVE_INT;
        }
        else if(klass == Long.class) {
            return BTreeKeySerializer.ZERO_OR_POSITIVE_LONG;
        }
        else if(klass == String.class) {
            return BTreeKeySerializer.STRING;
        }
        return null; //Default POJO serializer
    }
1204041
public static URLClassLoader loadJarToSystemClassLoader(File jarFile) {
		URLClassLoader urlClassLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
		loadJar(urlClassLoader, jarFile);
		return urlClassLoader;
	}
660697
public function set_method($identifier, $data, $ttl=0)
    {
    	$key = $this->_key($identifier);
    	$this->set($key, $data, $ttl);
    	return $data;
    }
1273959
@Nullable
  public IURLProtocol getProtocol (@Nullable final ISimpleURL aURL)
  {
    return aURL == null ? null : getProtocol (aURL.getPath ());
  }
606673
public function bindClass($class, $alias = false) {

        $self  = $this;
        $clean = $alias ? $alias : \trim(\strtolower(\str_replace("\\", "/", $class)), "\\");

        $this->bind('/'.$clean.'/*', function() use($self, $class, $clean) {

            $parts      = \explode('/', \trim(\preg_replace("#$clean#","",$self["route"],1),'/'));
            $action     = isset($parts[0]) ? $parts[0]:"index";
            $params     = \count($parts)>1 ? \array_slice($parts, 1):[];

            return $self->invoke($class,$action, $params);
        });

        $this->bind('/'.$clean, function() use($self, $class) {
            return $self->invoke($class, 'index', []);
        });
    }
1250884
protected static function getSingleton($class = null)
    {
        //super magic sauce getting the callers class
        if (is_null($class) && function_exists('get_called_class')) {
            $class = get_called_class();
        }
        
        //get routed class, if any
        $class = Route::i()->get($class);
        
        //if it's not set
        if (!isset(self::$instances[$class])) {
            //set it
            self::$instances[$class] = self::getInstance($class);
        }
        
        //return the cached version
        return self::$instances[$class];
    }
897210
public function set($key, $value, $ttl = null)
    {
        return $this->{$this->adapter}->set($this->keyPrefix . $key, $value, $ttl);
    }
279054
protected function loadResource(string $entityClass, string $url)
    {
        $resource = $this->restClient->getResource($entityClass, $url);

        return $resource->getEntity();
    }
1067445
public function setActionCustom(
        string $url = null,
        string $label = '',
        string $class = 'btn btn-primary btn-outline-primary btn-sm flat',
        string $icon = 'fa fa-paw'
    ): ButtonInterface {
        if (!$url) {
            $url = '#';
        }
        $this->setAction(self::TYPE_ACTION_CUSTOM)
            ->setUrl($url)
            ->setLabel($label)
            ->setClass($class)
            ->setIcon($icon);

        return $this;
    }
825838
public function loadClass($class)
    {
        $prefix = $class;

        while (($pos = strrpos($prefix, '\\')) !== false) {
            $prefix = substr($class, 0, $pos + 1);
            $relativeClass = substr($class, $pos + 1);

            $mappedFile = $this->_loadMappedFile($prefix, $relativeClass);
            if ($mappedFile) {
                return $mappedFile;
            }

            $prefix = rtrim($prefix, '\\');
        }

        return false;
    }
1259605
static function getToken($url, $login, $password) {
	    $responseEntity = RestHelper::post($url, [
		    'login' => $login,
		    'password' => $password,
	    ]);
	    if(!$responseEntity->is_ok) {
		    return null;
	    }
	    $token = self::getTokenFromResponse($responseEntity);
	    return $token;
    }
1003456
public function put($url, $class, $function)
    {
        $route = new Route($this->urlPrefix . $url, 'PUT', self::$CONTROLLERS_ROOT . $class, $function);
        $this->addRoute($route);
        return $route;
    }