/** * Returns an absolute path (to a directory or a file in the "real" file system) from a path relative to * the web application folder of OpenCms.<p> * * If the provided path is already absolute, then it is returned unchanged. * If the provided path is a folder, the result will always end with a folder separator.<p> * * @param path the path (relative) to generate an absolute path from * @return an absolute path (to a directory or a file) from a path relative to the web application folder of OpenCms */ public String getAbsoluteRfsPathRelativeToWebApplication(String path) { if ((path == null) || (getWebApplicationRfsPath() == null)) { return null; } // check for absolute path is system depended, let's just use the standard check File f = new File(path); if (f.isAbsolute()) { // apparently this is an absolute path already path = f.getAbsolutePath(); if (f.isDirectory() && !path.endsWith(File.separator)) { // make sure all folder paths end with a separator path = path.concat(File.separator); } return path; } return CmsFileUtil.normalizePath(getWebApplicationRfsPath() + path); }
/** * Returns an absolute path (to a directory or a file in the "real" file system) from a path relative to * the web application folder of OpenCms.<p> * * If the provided path is already absolute, then it is returned unchanged. * If the provided path is a folder, the result will always end with a folder separator.<p> * * @param path the path (relative) to generate an absolute path from * @return an absolute path (to a directory or a file) from a path relative to the web application folder of OpenCms */ public String getAbsoluteRfsPathRelativeToWebApplication(String path) { if ((path == null) || (getWebApplicationRfsPath() == null)) { return null; } // check for absolute path is system depended, let's just use the standard check File f = new File(path); if (f.isAbsolute()) { // apparently this is an absolute path already path = f.getAbsolutePath(); if (f.isDirectory() && !path.endsWith(File.separator)) { // make sure all folder paths end with a separator path = path.concat(File.separator); } return path; } return CmsFileUtil.normalizePath(getWebApplicationRfsPath() + path); }
/** * Sets the rfs export Path after normalizing.<p> * * @param exportPath the rfs export Path to set */ public void setExportPath(String exportPath) { if (exportPath.equals(OpenCms.getSystemInfo().getWebApplicationRfsPath())) { // not allowed because a full static export would delete the opencms directory throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_INVALID_EXPORT_PATH_1, m_name)); } m_exportPath = exportPath; }
/** * Sets the rfs export work Path after normalizing.<p> * * @param exportWorkPath the rfs export Work Path to set */ public void setExportWorkPath(String exportWorkPath) { if (exportWorkPath.equals(OpenCms.getSystemInfo().getWebApplicationRfsPath())) { // not allowed because a full static export would delete the opencms directory throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_INVALID_EXPORT_PATH_1, m_name)); } m_exportWorkPath = exportWorkPath; }
/** * Sets the rfs export Path after normalizing.<p> * * @param exportPath the rfs export Path to set */ public void setExportPath(String exportPath) { if (exportPath.equals(OpenCms.getSystemInfo().getWebApplicationRfsPath())) { // not allowed because a full static export would delete the opencms directory throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_INVALID_EXPORT_PATH_1, m_name)); } m_exportPath = exportPath; }
/** * Sets the rfs export work Path after normalizing.<p> * * @param exportWorkPath the rfs export Work Path to set */ public void setExportWorkPath(String exportWorkPath) { if (exportWorkPath.equals(OpenCms.getSystemInfo().getWebApplicationRfsPath())) { // not allowed because a full static export would delete the opencms directory throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_INVALID_EXPORT_PATH_1, m_name)); } m_exportWorkPath = exportWorkPath; }
icon.append("_disabled"); icon.append(iconPath.substring(iconPath.lastIndexOf('.'))); String resourcesRoot = OpenCms.getSystemInfo().getWebApplicationRfsPath() + "resources/"; File test = new File(resourcesRoot + icon.toString()); if (test.exists()) {
icon.append("_disabled"); icon.append(iconPath.substring(pos)); String resourcesRoot = OpenCms.getSystemInfo().getWebApplicationRfsPath() + "resources/"; File test = new File(resourcesRoot + icon.toString()); if (test.exists()) {
icon.append("_disabled"); icon.append(iconPath.substring(iconPath.lastIndexOf('.'))); String resourcesRoot = OpenCms.getSystemInfo().getWebApplicationRfsPath() + "resources/"; File test = new File(resourcesRoot + icon.toString()); if (test.exists()) {
icon.append("_disabled"); icon.append(iconPath.substring(iconPath.lastIndexOf('.'))); String resourcesRoot = OpenCms.getSystemInfo().getWebApplicationRfsPath() + "resources/"; File test = new File(resourcesRoot + icon.toString()); if (test.exists()) {
/** * Constructor.<p> * * @param adminCms the admin cms context */ public CmsUserIconHelper(CmsObject adminCms) { m_adminCms = adminCms; m_renderer = new IdentIcon(); m_renderer.setReservedColor(ADMIN_COLOR); m_cache = new CmsVfsNameBasedDiskCache( OpenCms.getSystemInfo().getWebApplicationRfsPath() + "/" + CmsWorkplace.RFS_PATH_RESOURCES, ICON_FOLDER); }
rfsPath = rfsPath.substring(OpenCms.getSystemInfo().getContextPath().length()); rfsPath = CmsStringUtil.joinPaths(OpenCms.getSystemInfo().getWebApplicationRfsPath(), rfsPath); File policyFile = new File(rfsPath); if (policyFile.exists() && policyFile.canRead()) {
/** * @see org.opencms.configuration.I_CmsConfigurationParameterHandler#initConfiguration() */ @Override public void initConfiguration() { if (CmsStringUtil.isEmpty(m_imageRepositoryFolder)) { m_imageRepositoryFolder = IMAGE_REPOSITORY_DEFAULT; } // initialize the image cache if (m_vfsDiskCache == null) { m_vfsDiskCache = new CmsVfsNameBasedDiskCache( OpenCms.getSystemInfo().getWebApplicationRfsPath(), m_imageRepositoryFolder); } OpenCms.addCmsEventListener(this); // output setup information if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info( Messages.get().getBundle().key( Messages.INIT_IMAGE_REPOSITORY_PATH_1, m_vfsDiskCache.getRepositoryPath())); CmsLog.INIT.info( Messages.get().getBundle().key(Messages.INIT_IMAGE_SCALING_ENABLED_1, Boolean.valueOf(m_enabled))); } }
/** * @see org.opencms.configuration.I_CmsConfigurationParameterHandler#initConfiguration() */ @Override public void initConfiguration() { super.initConfiguration(); if (CmsStringUtil.isEmpty(m_imageRepositoryFolder)) { m_imageRepositoryFolder = IMAGE_REPOSITORY_DEFAULT; } // initialize the image cache if (m_vfsDiskCache == null) { m_vfsDiskCache = new CmsVfsNameBasedDiskCache( OpenCms.getSystemInfo().getWebApplicationRfsPath(), m_imageRepositoryFolder); } OpenCms.addCmsEventListener(this); // output setup information if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info(Messages.get().getBundle().key( Messages.INIT_IMAGE_REPOSITORY_PATH_1, m_vfsDiskCache.getRepositoryPath())); CmsLog.INIT.info(Messages.get().getBundle().key( Messages.INIT_IMAGE_SCALING_ENABLED_1, Boolean.valueOf(m_enabled))); } }
m_jspRepository = OpenCms.getSystemInfo().getWebApplicationRfsPath();
m_jspRepository = OpenCms.getSystemInfo().getWebApplicationRfsPath();
if (m_staticExportPath.equals(OpenCms.getSystemInfo().getWebApplicationRfsPath())) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_INVALID_EXPORT_PATH_0));
if (m_staticExportPath.equals(OpenCms.getSystemInfo().getWebApplicationRfsPath())) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_INVALID_EXPORT_PATH_0));
break; case 4: // opencms.webbasepath result = OpenCms.getSystemInfo().getWebApplicationRfsPath(); break; case 5: // opencms.request.uri
break; case 4: // opencms.webbasepath result = OpenCms.getSystemInfo().getWebApplicationRfsPath(); break; case 5: // opencms.request.uri