cmsresourcetranslator.java
来自「找了很久才找到到源代码」· Java 代码 · 共 70 行
JAVA
70 行
/*
* File : $Source: /usr/local/cvs/opencms/src/org/opencms/util/CmsResourceTranslator.java,v $
* Date : $Date: 2007-08-13 16:29:56 $
* Version: $Revision: 1.25 $
*
* This library is part of OpenCms -
* the Open Source Content Management System
*
* Copyright (c) 2002 - 2007 Alkacon Software GmbH (http://www.alkacon.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* For further information about Alkacon Software GmbH, please see the
* company website: http://www.alkacon.com
*
* For further information about OpenCms, please see the
* project website: http://www.opencms.org
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.opencms.util;
import org.opencms.main.CmsLog;
import org.apache.commons.logging.Log;
import org.apache.oro.text.PatternCache;
import org.apache.oro.text.PatternCacheFIFO;
import org.apache.oro.text.perl.MalformedPerl5PatternException;
import org.apache.oro.text.perl.Perl5Util;
import org.apache.oro.text.regex.MalformedPatternException;
/**
* Provides a resource name / path translation facility.<p>
*
* This facility is used for translating new file names that contain
* illegal chars to legal names. This feature is most useful (and currently
* only used) for uploaded files. It is also applied to uploded ZIP directories
* that are extracted after upload.
* The rules that are used for resource name translation are available from
* {@link org.opencms.file.CmsRequestContext#getFileTranslator()}.<p>
*
* Optionally, resource name translation is also applied to all files read
* from the VFS, so it can be used for accessing files out of teir usual context.
* This feature is called directoy translation, and the configured directory
* translations are available from {@link org.opencms.file.CmsRequestContext#getDirectoryTranslator()}.<p>
*
* Directory translation was originally required for backward compatibility
* to the directory layout before OpenCms 5.0 beta 2. In a modern installation,
* directory translation is usually disabled.<p>
*
* The translations can be configured in <code>opencms-vfs.xml</code>
* in the <code>opencms\vfs\resources\translations</code> node.<p>
*
* The default file name translation setting is:<br>
* <pre>
* <filetranslations enabled="true">
* <translation>s#[\s]+#_#g</translation>
* <translation>s#\\#/#g</translation>
* <translation>s#
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?