original_string: public function get_rootpath() {
          global $CFG;
          $subdir = clean_param(trim($this->subdir, '/'), PARAM_PATH);
          $path = $CFG->dataroot . '/repository/' . $this->subdir . '/';
          if ((empty($this->subdir) && !is_numeric($this->subdir)) || $subdir != $this->subdir || !is_dir($path)) {
              throw new repository_exception('The instance is not properly configured, invalid path.');
          }
          return $path;
      }
code: public function get_rootpath() {
          global $CFG;
          $subdir = clean_param(trim($this->subdir, '/'), PARAM_PATH);
          $path = $CFG->dataroot . '/repository/' . $this->subdir . '/';
          if ((empty($this->subdir) && !is_numeric($this->subdir)) || $subdir != $this->subdir || !is_dir($path)) {
              throw new repository_exception('The instance is not properly configured, invalid path.');
          }
          return $path;
      }
code_tokens: public function get_rootpath ( ) { global $ CFG ; $ subdir = clean_param ( trim ( $ this -> subdir , '/' ) , PARAM_PATH ) ; $ path = $ CFG -> dataroot . '/repository/' . $ this -> subdir . '/' ; if ( ( empty ( $ this -> subdir ) && ! is_numeric ( $ this -> subdir ) ) || $ subdir != $ this -> subdir || ! is_dir ( $ path ) ) { throw new repository_exception ( 'The instance is not properly configured, invalid path.' ) ; } return $ path ; }
docstring: Return the rootpath of this repository instance.
  
  Trim() is a necessary step to ensure that the subdirectory is not '/'.
  
  @return string path
  @throws repository_exception If the subdir is unsafe, or invalid.
docstring_tokens: Return the rootpath of this repository instance .