Returns the current tool path.<p>

@param wp the workplace object

@return the current tool path
484261
public String getCurrentToolPath(CmsWorkplace wp) {

        CmsToolUserData userData = getUserData(wp);
        String path = getBaseToolPath(wp);
        if (userData != null) {
            path = userData.getCurrentToolPath(getCurrentRoot(wp).getKey());
        }
        return path;
    }
837107
function getCurrentPath(){

  try{

    // FF, Chrome, Modern browsers
    // use their API to get the path of current script

    // a.b();
    // console.log('wpStage1');

    return document.currentScript.src;

    if(DOC.currentScript){ // FF 4+
      return DOC.currentScript.src;
    }

  }catch(e){

    // document.currentScript doesn't supports

    // console.log('wpStage2');

    // Method 1
    // https://github.com/mozilla/pdf.js/blob/e081a708c36cb2aacff7889048863723fcf23671/src/shared/compatibility.js#L97
    // IE, Chrome < 29

    let scripts = document.getElementsByTagName('script');
    return scripts[scripts.length - 1].src;

/*
    // Method 2
    // parse the error stack trace maually
    // https://github.com/workhorsy/uncompress.js/blob/master/js/uncompress.js#L25

    let stack = e.stack;
    let line = null;

    // Chrome and IE
    if (stack.indexOf('@') !== -1) {
      line = stack.split('@')[1].split('\n')[0];
    // Firefox
    } else {
      line = stack.split('(')[1].split(')')[0];
    }
    line = line.substring(0, line.lastIndexOf('/')) + '/';
    return line;
*/
/*
    // Method 3
    // https://www.cnblogs.com/rubylouvre/archive/2013/01/23/2872618.html

    let stack = e.stack;
    if(!stack && window.opera){
      // Opera 9没有e.stack,但有e.Backtrace,但不能直接取得,需要对e对象转字符串进行抽取
      stack = (String(e).match(/of linked script \S+/g) || []).join(' ');
    }
    if(stack){
      // e.stack最后一行在所有支持的浏览器大致如下:
      // chrome23:
      // @ http://113.93.50.63/data.js:4:1
      // firefox17:
      // @http://113.93.50.63/query.js:4
      // opera12:
      // @http://113.93.50.63/data.js:4
      // IE10:
      // @ Global code (http://113.93.50.63/data.js:4:1)
      stack = stack.split(/[@ ]/g).pop(); // 取得最后一行,最后一个空格或@之后的部分
      stack = stack[0] == '(' ? stack.slice(1,-1) : stack;
      return stack.replace(/(:\d+)?:\d+$/i, ''); // 去掉行号与或许存在的出错字符起始位置
    }
    let nodes = head.getElementsByTagName('script'); // 只在head标签中寻找
    for(var i = 0, node; node = nodes[i++];){
      if(node.readyState === 'interactive'){
        return node.className = node.src;
      }
    }
*/
  }

}
328382
public Map<String, String> getSitePath() {

        if (m_sitePaths == null) {
            m_sitePaths = CmsCollectionsGenericWrapper.createLazyMap(new Transformer() {

                public Object transform(Object rootPath) {

                    if (rootPath instanceof String) {
                        return getRequestContext().removeSiteRoot((String)rootPath);
                    }
                    return null;
                }
            });
        }
        return m_sitePaths;
    }
130977
public synchronized void initParams(CmsToolDialog wp) {

        setCurrentRoot(wp, wp.getParamRoot());
        setCurrentToolPath(wp, wp.getParamPath());
        setBaseToolPath(wp, wp.getParamBase());

        // if the current tool path is not under the current root, set the current root as the current tool
        if (!getCurrentToolPath(wp).startsWith(getBaseToolPath(wp))) {
            setCurrentToolPath(wp, getBaseToolPath(wp));
        }
        wp.setParamPath(getCurrentToolPath(wp));
        wp.setParamBase(getBaseToolPath(wp));
        wp.setParamRoot(getCurrentRoot(wp).getKey());
    }
154880
public @CheckForNull FilePath getWorkspaceRoot() {
        FilePath r = getRootPath();
        if(r==null) return null;
        return r.child(WORKSPACE_ROOT);
    }
1033791
public String getParent(CmsWorkplace wp, String toolPath) {

        if (toolPath.equals(getBaseToolPath(wp))) {
            return toolPath;
        }
        int pos = toolPath.lastIndexOf(TOOLPATH_SEPARATOR);
        return pos <= 0 ? TOOLPATH_SEPARATOR : toolPath.substring(0, pos);
    }
1305400
private static function getWorkbenchPath()
    {
        if (empty(self::$workbenchPath)) {
            self::$workbenchPath = sprintf(
                '%s%s%s%s',
                self::getBasePath(),
                DIRECTORY_SEPARATOR,
                time(),
                rand(100, 999)
            );
        }
        return self::$workbenchPath;
    }
889228
public String getApiPath() {
		if (StringUtils.isBlank(path)) {
			return DEFAULT_PATH;
		} else {
			if (!path.endsWith("/")) {
				path += "/";
			}
			return path;
		}
	}
882454
private String getLegend() {

        switch (m_mode) {
            case sources:
                return org.opencms.gwt.client.Messages.get().key(
                    org.opencms.gwt.client.Messages.GUI_RESOURCE_INFO_TAB_USAGE_0);
            case targets:

                return org.opencms.gwt.client.Messages.get().key(
                    org.opencms.gwt.client.Messages.GUI_RESOURCE_INFO_TAB_TARGETS_0);
            case siblings:
            default:
                return org.opencms.gwt.client.Messages.get().key(
                    org.opencms.gwt.client.Messages.GUI_RESOURCE_INFO_TAB_SIBLINGS_0);

        }

    }
236055
public String getCurrentResourceName() {

        if (isMultiOperation()) {
            return "";
        }
        String resourceName = CmsResource.getName(getParamResource());
        if (resourceName.endsWith("/")) {
            resourceName = resourceName.substring(0, resourceName.length() - 1);
        }
        return resourceName;
    }
1011499
public FilePath getCurrentWorkspace() {
        lock.readLock().lock();
        try {
            if (executable == null) {
                return null;
            }
            if (executable instanceof AbstractBuild) {
                AbstractBuild ab = (AbstractBuild) executable;
                return ab.getWorkspace();
            }
            return null;
        } finally {
            lock.readLock().unlock();
        }
    }
135490
public String getPath() {

        StringBuffer path = new StringBuffer("/");
        CmsTreeItem current = this;
        while (current != null) {
            path.insert(0, current.getId()).insert(0, "/");
            current = current.getParentItem();
        }
        String result = path.toString();
        if (result.startsWith("//")) {
            // This happens if the root item has an empty id.
            // In that case, we cut off the first slash.
            result = result.substring(1);
        }
        return result;
    }
842752
public function get_default_path() {
		if ( ! defined( 'ABSPATH' ) ) {
			throw \RuntimeException( 'ABSPATH constant is not defined.  Something is very wrong!' );
		}

		$default_path = $this->default_path;
		// Allow to change this in wp-config.php or elsewhere.
		if ( defined( 'QB_CUSTOM_THEME_PATH' ) ) {
			$default_path = QB_CUSTOM_THEME_PATH;
		}

		$result = ABSPATH . $default_path;

		return $result;
	}
45249
public CmsTool getCurrentTool(CmsWorkplace wp) {

        return resolveAdminTool(getCurrentRoot(wp).getKey(), getCurrentToolPath(wp));
    }
304575
public function get_url() {

		/**
		 * Start by replacing ABSPATH with site_url.
		 * This is not accurate at all and only serves as a fallback in case everything else fails.
		 */
		$this->url = \str_replace( ABSPATH, \trailingslashit( \site_url() ), $this->path );

		/**
		 * If the file-path is inside wp-content replace the content-path with the content-url.
		 * This serves as a fallback in case the other tests below fail.
		 */
		if ( false !== \strpos( $this->path, self::$content_path ) ) {
			$this->url = \str_replace( self::$content_path, self::$content_url, $this->path );
		}

		/**
		 * If the file is in a parent theme use the template directory.
		 */
		if ( $this->in_parent_theme() ) {
			$this->url = \get_template_directory_uri() . \str_replace( \get_template_directory(), '', $this->path );
		}

		/**
		 * If the file is in a child-theme use the stylesheet directory.
		 */
		if ( ! $this->in_parent_theme() && $this->in_child_theme() ) {
			$this->url = \get_stylesheet_directory_uri() . \str_replace( \get_stylesheet_directory(), '', $this->path );
		}

		$this->url = \set_url_scheme( $this->url );
		return \apply_filters( 'kirki_path_url', $this->url, $this->path );
	}
720400
static public function getCurrentPath()
	{
	    $baseUrl = static::getRootUrl();
	    $parts = parse_url(static::getCurrentUrl());
	    $baseUrl .= isset($parts['path']) ? $parts['path'] : null;
	    
	    return rtrim($baseUrl, '/');
	}
133163
public static String getWebProjectPath(Object currentObject) {

        Class<? extends Object> class1 = currentObject.getClass();
        ClassLoader classLoader = class1.getClassLoader();
        URL resource = classLoader.getResource("/");
        String path = resource.getPath();
        int webRootIndex = StringUtils.indexOfIgnoreCase(path, "WEB-INF");
        if (path.indexOf(":/") > 0) {
            return path.substring(1, webRootIndex);
        } else {
            return path.substring(0, webRootIndex);
        }
    }