Returns the context for static resources served from the class path, e.g. "/opencms/opencms/handleStatic".<p>

@return the static resource context
433824
public String getStaticResourceContext() {

        if (m_staticResourcePathFragment == null) {
            m_staticResourcePathFragment = CmsStaticResourceHandler.getStaticResourceContext(
                OpenCms.getStaticExportManager().getVfsPrefix(),
                getVersionNumber());
        }
        return m_staticResourcePathFragment;
    }
1061108
protected Context getContext() {
        if (act != null) {
            return act;
        }
        if (root != null) {
            return root.getContext();
        }
        return context;
    }
397980
public String getExplorerResource() {

        // get the current explorer mode
        String mode = getExplorerMode();
        if (mode == null) {
            mode = CmsWorkplace.VIEW_EXPLORER;
        }
        if (CmsWorkplace.VIEW_EXPLORER.equals(mode)) {
            // append the current site to the key when in explorer view mode
            mode += "_" + getSite() + "/";
        }
        // get the resource for the given mode
        String resource = m_explorerResource.get(mode);
        if (resource == null) {
            resource = "/";
        }
        return resource;
    }
606965
public static Context getContext() {
        Context context = LOCAL.get();
        if (context == null) {
            context = new Context(null, null);
            LOCAL.set(context);
        }
        return context;
    }
173437
private Set<String> getResourcesToScan() {

		final String classPath    = System.getProperty("java.class.path");
		final Set<String> modules = new TreeSet<>();
		final Pattern pattern     = Pattern.compile(".*(structr).*(war|jar)");
		final Matcher matcher     = pattern.matcher("");

		for (final String jarPath : classPath.split("[".concat(pathSep).concat("]+"))) {

			final String lowerPath = jarPath.toLowerCase();

			if (lowerPath.endsWith(classesDir) || lowerPath.endsWith(testClassesDir)) {

				modules.add(jarPath);

			} else {

				final String moduleName = lowerPath.substring(lowerPath.lastIndexOf(pathSep) + 1);

				matcher.reset(moduleName);

				if (matcher.matches()) {

					modules.add(jarPath);
				}

			}

		}

		for (final String resource : Services.getInstance().getResources()) {

			final String lowerResource = resource.toLowerCase();

			if (lowerResource.endsWith(".jar") || lowerResource.endsWith(".war")) {

				modules.add(resource);
			}

		}

		return modules;
	}
736127
@Override
    public String getContextPath() {
        ServletRESTRequestImpl ret = castRequest();
        if (ret != null)
            return ret.getContextPath();
        return null;
    }
892689
public CmsPublishOptions getResourceOptions() throws CmsRpcException {

        CmsPublishOptions result = null;
        try {
            result = getCachedOptions();
        } catch (Throwable e) {
            error(e);
        }
        return result;
    }
477465
protected List<CmsResource> getImages() {

        // get all image resources of the folder
        int imageId;
        try {
            imageId = OpenCms.getResourceManager().getResourceType(
                CmsResourceTypeImage.getStaticTypeName()).getTypeId();
        } catch (CmsLoaderException e1) {
            // should really never happen
            LOG.warn(e1.getLocalizedMessage(), e1);
            imageId = CmsResourceTypeImage.getStaticTypeId();
        }
        CmsResourceFilter filter = CmsResourceFilter.IGNORE_EXPIRATION.addRequireType(imageId);
        try {
            return getCms().readResources(getParamResource(), filter, false);
        } catch (CmsException e) {
            // log, should never happen
            if (LOG.isErrorEnabled()) {
                LOG.error(e.getLocalizedMessage(getLocale()));
            }
            return Collections.emptyList();
        }
    }
174575
private CmsObject getCmsObject() {

        CmsObject cms;
        try {
            cms = OpenCms.initCmsObject(A_CmsUI.getCmsObject());
            //m_cms.getRequestContext().setSiteRoot("");
        } catch (CmsException e) {
            cms = A_CmsUI.getCmsObject();
        }
        return cms;
    }
1157884
public Context getContext() {
		if (context == null) {
			context = Model.getSingleton().getSession().getContext(this.contextId);
		}
		return context;
	}
613009
private List<CmsResource> getResources() {

        List<CmsResource> result = new LinkedList<CmsResource>();
        CmsObject cms = getCms();
        CmsResourceFilter filter = CmsResourceFilter.ALL;
        try {
            for (String path : m_paths) {
                List<CmsResource> resources = cms.readResources(path, filter, true);
                result.addAll(resources);
            }
        } catch (CmsException e) {
            if (LOG.isErrorEnabled()) {
                LOG.error(Messages.get().getBundle().key(Messages.LOG_ERR_PROPERTYVIEWER_READRESOURCES_0), e);
            }
            result = Collections.emptyList();
        }
        return result;
    }
662569
public static String getCurrentContextClassLoaderClassPath(){
        URLClassLoader contextClassLoader = (URLClassLoader) Thread.currentThread().getContextClassLoader();
        return getUrlClassLoaderClassPath(contextClassLoader);
    }
217113
public static URL getResource(String resource, Class<?> context)
    {
        return getResource(resource, context, false);
    }
659186
public static URL getResource(String name) {
        URL resource = null;
        try {
            if (Thread.currentThread().getContextClassLoader() != null) {
                resource = Thread.currentThread().getContextClassLoader().getResource(name);
            }
        } catch (SecurityException e) {
            LOG.info("Unable to access context classloader, using default. " + e.getMessage());
        }
        if (resource == null) {
            resource = ResourceLoader.class.getResource("/" + name);
        }
        return resource;
    }
1323327
public static String getStaticResourceUri(String resourceName, String versionInfo) {

        resourceName = CmsStaticResourceHandler.removeStaticResourcePrefix(resourceName);
        String uri = CmsStringUtil.joinPaths(OpenCms.getSystemInfo().getStaticResourceContext(), resourceName);
        if (versionInfo != null) {
            uri += "?v=" + versionInfo;
        }
        return uri;
    }
1062322
private List<String> getResources() {

        List<String> res = new ArrayList<String>();

        for (I_CmsEditableGroupRow row : m_resourcesGroup.getRows()) {
            FormLayout layout = (FormLayout)(row.getComponent());
            CmsPathSelectField field = (CmsPathSelectField)layout.getComponent(0);
            if (!field.getValue().isEmpty() & !res.contains(field.getValue())) {
                res.add(field.getValue());
            }
        }

        return res;
    }
1011708
public static String getStaticPath() {
        if (null == staticPath) {
            staticPath = getLatkeProperty("staticPath");

            if (null == staticPath) {
                staticPath = getContextPath();
            }
        }

        return staticPath;
    }