public String substituteMatch(String text, Matcher matcher) { String name = text.substring(matcher.start(1), matcher.end(1)); return "/" + OpenCms.getResourceManager().getFileTranslator().translateResource(name); } });
/** * Converts a CIFS path to an OpenCms path by converting backslashes to slashes and translating special characters in the file name.<p> * * @param path the path to transform * @param fileTranslation flag indicating whether file name translation should be used * @return the OpenCms path for the given path */ protected static String getCmsPath(String path, boolean fileTranslation) { String slashPath = path.replace('\\', '/'); // split path into components, translate each of them separately, then combine them again at the end String[] segments = slashPath.split("/"); List<String> nonEmptySegments = new ArrayList<String>(); for (String segment : segments) { if (segment.length() > 0) { String translatedSegment = "*".equals(segment) ? "*" : (fileTranslation ? OpenCms.getResourceManager().getFileTranslator().translateResource(segment) : segment); nonEmptySegments.add(translatedSegment); } } String result = "/" + Joiner.on("/").join(nonEmptySegments); return result; }
/** * Returns the configured rfs export Work Path with unsubstituted context values.<p> * * @return the configured rfs export Work Path */ public String getExportWorkPathConfigured() { if (m_exportWorkPathConfigured != null) { return m_exportWorkPathConfigured; } // if work path not configured set to default value return CmsStaticExportManager.EXPORT_DEFAULT_WORKPATH + OpenCms.getResourceManager().getFileTranslator().translateResource(m_name); }
/** * This default implementation will just generate a 5 digit sequence that is appended to the resource name in case * of a collision of names.<p> * * @see org.opencms.loader.I_CmsFileNameGenerator#getUrlNameSequence(java.lang.String) */ public Iterator<String> getUrlNameSequence(String baseName) { String translatedTitle = OpenCms.getResourceManager().getFileTranslator().translateResource(baseName).replace( "/", "-"); return new CmsNumberSuffixNameSequence(translatedTitle); }
/** * Returns the configured rfs export Work Path with unsubstituted context values.<p> * * @return the configured rfs export Work Path */ public String getExportWorkPathConfigured() { if (m_exportWorkPathConfigured != null) { return m_exportWorkPathConfigured; } // if work path not configured set to default value return CmsStaticExportManager.EXPORT_DEFAULT_WORKPATH + OpenCms.getResourceManager().getFileTranslator().translateResource(m_name); }
clientfile = (String)it.next(); vfsfile = new StringBuffer(currentFolder).append(clientfile).toString(); vfsfile = OpenCms.getResourceManager().getFileTranslator().translateResource(vfsfile); if (getCms().existsResource(vfsfile)) { result.append(CmsEncoder.encode(clientfile, CmsEncoder.ENCODING_UTF_8));
clientfile = it.next(); vfsfile = new StringBuffer(currentFolder).append(clientfile).toString(); vfsfile = OpenCms.getResourceManager().getFileTranslator().translateResource(vfsfile); if (getCms().existsResource(vfsfile)) { result.append(CmsEncoder.encode(clientfile, CmsEncoder.ENCODING_UTF_8));
return OpenCms.getResourceManager().getFileTranslator().translateResource(validFilename);
/** * Appends the full path to the new resource name given in the resource parameter.<p> * * @return the full path of the new resource */ protected String computeFullResourceName() { // return the full resource name // get the current folder String currentFolder = getParamCurrentFolder(); if (CmsStringUtil.isEmpty(currentFolder)) { currentFolder = computeCurrentFolder(); } String translatedFilename = OpenCms.getResourceManager().getFileTranslator().translateResource(getParamResource()); return currentFolder + translatedFilename; }
/** * Appends the full path to the new resource name given in the resource parameter.<p> * * @return the full path of the new resource */ protected String computeFullResourceName() { // return the full resource name // get the current folder String currentFolder = getParamCurrentFolder(); if (CmsStringUtil.isEmpty(currentFolder)) { currentFolder = computeCurrentFolder(); } String translatedFilename = OpenCms.getResourceManager().getFileTranslator().translateResource( getParamResource()); return currentFolder + translatedFilename; }
rule.getExportPath(), rule.getExportBackups().intValue(), OpenCms.getResourceManager().getFileTranslator().translateResource(rule.getName())); staticExportWorkRule.renameTo(new File(rule.getExportPath()));
baseName = OpenCms.getResourceManager().getFileTranslator().translateResource(baseName);
rule.getExportPath(), rule.getExportBackups().intValue(), OpenCms.getResourceManager().getFileTranslator().translateResource(rule.getName())); staticExportWorkRule.renameTo(new File(rule.getExportPath()));
/** * @see org.opencms.ade.sitemap.shared.rpc.I_CmsSitemapService#changeCategory(java.lang.String, org.opencms.util.CmsUUID, java.lang.String, java.lang.String) */ public void changeCategory(String entryPoint, CmsUUID id, String title, String name) throws CmsRpcException { try { name = OpenCms.getResourceManager().getFileTranslator().translateResource(name.trim().replace('/', '-')); CmsObject cms = getCmsObject(); CmsResource categoryResource = cms.readResource(id); ensureLock(categoryResource); String sitePath = cms.getSitePath(categoryResource); String newPath = CmsStringUtil.joinPaths(CmsResource.getParentFolder(sitePath), name); cms.writePropertyObject(sitePath, new CmsProperty(CmsPropertyDefinition.PROPERTY_TITLE, title, null)); if (!CmsStringUtil.joinPaths("/", newPath, "/").equals(CmsStringUtil.joinPaths("/", sitePath, "/"))) { cms.moveResource(sitePath, newPath); } } catch (Exception e) { error(e); } }
tryUnlock(parent); String folderName = OpenCms.getResourceManager().getFileTranslator().translateResource(title);
name = OpenCms.getResourceManager().getFileTranslator().translateResource(name.trim().replace('/', '-')); CmsObject cms = getCmsObject(); CmsCategoryService catService = CmsCategoryService.getInstance();
contextInfo.getRequestTime(), m_resourceManager.getFolderTranslator(), m_resourceManager.getFileTranslator(), contextInfo.getOuFqn()); context.setDetailResource(contextInfo.getDetailResource());