/** * Returns the resource root path in the OpenCms VFS for the given target URI link, or <code>null</code> in * case the link points to an external site.<p> * * This methods does not support relative target URI links, so the given URI must be an absolute link.<p> * * See {@link #getRootPath(CmsObject, String)} for a full explanation of this method.<p> * * @param cms the current users OpenCms context * @param targetUri the target URI link * * @return the resource root path in the OpenCms VFS for the given target URI link, or <code>null</code> in * case the link points to an external site * * @see #getRootPath(CmsObject, String, String) * * @since 7.0.2 */ public String getRootPath(CmsObject cms, String targetUri) { return getRootPath(cms, targetUri, null); }
/** * Returns the resource root path in the OpenCms VFS for the given target URI link, or <code>null</code> in * case the link points to an external site.<p> * * This methods does not support relative target URI links, so the given URI must be an absolute link.<p> * * See {@link #getRootPath(CmsObject, String)} for a full explanation of this method.<p> * * @param cms the current users OpenCms context * @param targetUri the target URI link * * @return the resource root path in the OpenCms VFS for the given target URI link, or <code>null</code> in * case the link points to an external site * * @see #getRootPath(CmsObject, String, String) * * @since 7.0.2 */ public String getRootPath(CmsObject cms, String targetUri) { return getRootPath(cms, targetUri, null); }
/** * Returns the resource root path for the given target URI in the OpenCms VFS, or <code>null</code> in * case the target URI points to an external site.<p> * * @param cms the current users OpenCms context * @param basePath path to use as base site for the target URI (can be <code>null</code>) * @param targetUri the target URI * * @return the resource root path for the given target URI in the OpenCms VFS, or <code>null</code> in * case the target URI points to an external site * * @deprecated use {@link #getRootPath(CmsObject, String, String)} instead, obtain the link manager * with {@link OpenCms#getLinkManager()} */ public static String getSitePath(CmsObject cms, String basePath, String targetUri) { return OpenCms.getLinkManager().getRootPath(cms, targetUri, basePath); }
/** * Returns the resource root path for the given target URI in the OpenCms VFS, or <code>null</code> in * case the target URI points to an external site.<p> * * @param cms the current users OpenCms context * @param basePath path to use as base site for the target URI (can be <code>null</code>) * @param targetUri the target URI * * @return the resource root path for the given target URI in the OpenCms VFS, or <code>null</code> in * case the target URI points to an external site * * @deprecated use {@link #getRootPath(CmsObject, String, String)} instead, obtain the link manager * with {@link OpenCms#getLinkManager()} */ @Deprecated public static String getSitePath(CmsObject cms, String basePath, String targetUri) { return OpenCms.getLinkManager().getRootPath(cms, targetUri, basePath); }
/** * Reads a file from the VFS.<p> * * @param uriWithParams the * @return the file data */ private byte[] readFile(String uriWithParams) { try { String pathAndQuery = OpenCms.getLinkManager().getRootPath(m_cms, uriWithParams); URI uri = new URI(pathAndQuery); String path = uri.getPath(); CmsFile file = m_rootCms.readFile(path); return file.getContents(); } catch (Exception e) { LOG.error("Problem with reading CSS " + uriWithParams + ": " + e.getLocalizedMessage(), e); return null; } }
String pathAndQuery = OpenCms.getLinkManager().getRootPath(m_cms, uriWithParams); URI uri = new URI(pathAndQuery); String path = uri.getPath();
} else { String policyPath = OpenCms.getLinkManager().getRootPath(cms, m_serializationPolicyPath); is = new ByteArrayInputStream(cms.readFile(policyPath).getContents());
sitePath = getRootPath(cms, link); if (sitePath == null) {
sitePath = getRootPath(cms, link); if (sitePath == null) {
String internalUri = null; if (!CmsMacroResolver.isMacro(targetUri)) { internalUri = OpenCms.getLinkManager().getRootPath(m_cms, targetUri, m_relativePath);
CmsDefaultLinkSubstitutionHandler.DONT_USE_CURRENT_SITE_FOR_WORKPLACE_REQUESTS, "true"); internalUri = OpenCms.getLinkManager().getRootPath(m_cms, targetUri, m_relativePath);
path = OpenCms.getLinkManager().getRootPath(cms, path); if (path != null) {
path = OpenCms.getLinkManager().getRootPath(cms, path); if (path != null) {
path = OpenCms.getLinkManager().getRootPath(cms, path); if (path != null) {
path = OpenCms.getLinkManager().getRootPath(cms, path); if (path == null) { path = value;
path = OpenCms.getLinkManager().getRootPath(cms, path); if (path == null) { path = value;
resName = resourceName.substring(0, pos); String resNameWithoutServer = OpenCms.getLinkManager().getRootPath(getCmsObject(), resName); if (resNameWithoutServer != null) { resName = resNameWithoutServer;
path = OpenCms.getLinkManager().getRootPath(cms, path);