⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmsxmladdmimetypes.java

📁 找了很久才找到到源代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
        {".snd", "audio/basic"},
        {".it", "audio/it"},
        {".funk", "audio/make"},
        {".my", "audio/make"},
        {".pfunk", "audio/makemyfunk"},
        {".rmi", "audio/mid"},
        {".kar", "audio/midi"},
        {".mid", "audio/midi"},
        {".midi", "audio/midi"},
        {".m2a", "audio/mpeg"},
        {".mp2", "audio/mpeg"},
        {".mp3", "audio/mpeg"},
        {".mpga", "audio/mpeg"},
        {".s3m", "audio/s3m"},
        {".tsi", "audio/tsp-audio"},
        {".tsp", "audio/tsplayer"},
        {".qcp", "audio/vndqcelp"},
        {".vox", "audio/voxware"},
        {".aif", "audio/x-aiff"},
        {".aifc", "audio/x-aiff"},
        {".aiff", "audio/x-aiff"},
        {".gsd", "audio/x-gsm"},
        {".gsm", "audio/x-gsm"},
        {".jam", "audio/x-jam"},
        {".lam", "audio/x-liveaudio"},
        {".mod", "audio/x-mod"},
        {".m3u", "audio/x-mpegurl"},
        {".wma", "audio/x-ms-wma"},
        {".la", "audio/x-nspaudio"},
        {".lma", "audio/x-nspaudio"},
        {".ram", "audio/x-pn-realaudio"},
        {".rm", "audio/x-pn-realaudio"},
        {".rmm", "audio/x-pn-realaudio"},
        {".rmp", "audio/x-pn-realaudio-plugin"},
        {".rpm", "audio/x-pn-realaudio-plugin"},
        {".sid", "audio/x-psid"},
        {".ra", "audio/x-realaudio"},
        {".vqf", "audio/x-twinvq"},
        {".vqe", "audio/x-twinvq-plugin"},
        {".vql", "audio/x-twinvq-plugin"},
        {".mjf", "audio/x-vndaudioexplosionmjuicemediafile"},
        {".voc", "audio/x-voc"},
        {".wav", "audio/x-wav"},
        {".xm", "audio/xm"},
        {".pdb", "chemical/x-pdb"},
        {".xyz", "chemical/x-pdb"},
        {".ivr", "i-world/i-vrml"},
        {".bm", "image/bmp"},
        {".bmp", "image/bmp"},
        {".rast", "image/cmu-raster"},
        {".fif", "image/fif"},
        {".flo", "image/florian"},
        {".turbot", "image/florian"},
        {".g3", "image/g3fax"},
        {".gif", "image/gif"},
        {".ief", "image/ief"},
        {".iefs", "image/ief"},
        {".jfif-tbnl", "image/jpeg"},
        {".jpe", "image/jpeg"},
        {".jpeg", "image/jpeg"},
        {".jpg", "image/jpeg"},
        {".jut", "image/jutvision"},
        {".nap", "image/naplps"},
        {".naplps", "image/naplps"},
        {".pic", "image/pict"},
        {".pict", "image/pict"},
        {".jfif", "image/pjpeg"},
        {".png", "image/png"},
        {".x-png", "image/png"},
        {".svg", "image/svg+xml"},
        {".tif", "image/tiff"},
        {".tiff", "image/tiff"},
        {".wbmp", "image/vnd.wap.wbmp"},
        {".fpx", "image/vndnet-fpx"},
        {".rf", "image/vndrn-realflash"},
        {".rp", "image/vndrn-realpix"},
        {".xif", "image/vndxiff"},
        {".ras", "image/x-cmu-raster"},
        {".dwg", "image/x-dwg"},
        {".dxf", "image/x-dwg"},
        {".svf", "image/x-dwg"},
        {".ico", "image/x-icon"},
        {".art", "image/x-jg"},
        {".jps", "image/x-jps"},
        {".nif", "image/x-niff"},
        {".niff", "image/x-niff"},
        {".pcx", "image/x-pcx"},
        {".pct", "image/x-pict"},
        {".pnm", "image/x-portable-anymap"},
        {".pbm", "image/x-portable-bitmap"},
        {".pgm", "image/x-portable-graymap"},
        {".ppm", "image/x-portable-pixmap"},
        {".qif", "image/x-quicktime"},
        {".qti", "image/x-quicktime"},
        {".qtif", "image/x-quicktime"},
        {".rgb", "image/x-rgb"},
        {".xbm", "image/x-xbitmap"},
        {".xpm", "image/x-xpixmap"},
        {".xwd", "image/x-xwindowdump"},
        {".mht", "message/rfc822"},
        {".mhtml", "message/rfc822"},
        {".iges", "model/iges"},
        {".igs", "model/iges"},
        {".mesh", "model/mesh"},
        {".msh", "model/mesh"},
        {".silo", "model/mesh"},
        {".dwf", "model/vnddwf"},
        {".vrml", "model/vrml"},
        {".wrl", "model/vrml"},
        {".pov", "model/x-pov"},
        {".gzip", "multipart/x-gzip"},
        {".pvu", "paleovu/x-pv"},
        {".asp", "text/asp"},
        {".csv", "text/comma-separated-values"},
        {".css", "text/css"},
        {".acgi", "text/html"},
        {".htm", "text/html"},
        {".html", "text/html"},
        {".htmls", "text/html"},
        {".htx", "text/html"},
        {".mcf", "text/mcf"},
        {".pas", "text/pascal"},
        {".asc", "text/plain"},
        {".c++", "text/plain"},
        {".com", "text/plain"},
        {".conf", "text/plain"},
        {".cxx", "text/plain"},
        {".def", "text/plain"},
        {".g", "text/plain"},
        {".idc", "text/plain"},
        {".list", "text/plain"},
        {".log", "text/plain"},
        {".lst", "text/plain"},
        {".mar", "text/plain"},
        {".sdml", "text/plain"},
        {".text", "text/plain"},
        {".txt", "text/plain"},
        {".rtx", "text/richtext"},
        {".rtf", "text/rtf"},
        {".wsc", "text/scriplet"},
        {".sgm", "text/sgml"},
        {".sgml", "text/sgml"},
        {".tsv", "text/tab-separated-values"},
        {".uni", "text/uri-list"},
        {".unis", "text/uri-list"},
        {".uri", "text/uri-list"},
        {".uris", "text/uri-list"},
        {".wml", "text/vnd.wap.wml"},
        {".abc", "text/vndabc"},
        {".flx", "text/vndfmiflexstor"},
        {".rt", "text/vndrn-realtext"},
        {".wmls", "text/vndwapwmlscript"},
        {".htt", "text/webviewhtml"},
        {".asm", "text/x-asm"},
        {".s", "text/x-asm"},
        {".aip", "text/x-audiosoft-intra"},
        {".c", "text/x-c"},
        {".cc", "text/x-c"},
        {".cpp", "text/x-c"},
        {".htc", "text/x-component"},
        {".f", "text/x-fortran"},
        {".f77", "text/x-fortran"},
        {".f90", "text/x-fortran"},
        {".for", "text/x-fortran"},
        {".h", "text/x-h"},
        {".hh", "text/x-h"},
        {".jav", "text/x-java-source"},
        {".java", "text/x-java-source"},
        {".lsx", "text/x-la-asf"},
        {".m", "text/x-m"},
        {".p", "text/x-pascal"},
        {".hlb", "text/x-script"},
        {".el", "text/x-scriptelisp"},
        {".ksh", "text/x-scriptksh"},
        {".lsp", "text/x-scriptlisp"},
        {".pl", "text/x-scriptperl"},
        {".pm", "text/x-scriptperl-module"},
        {".py", "text/x-scriptphyton"},
        {".rexx", "text/x-scriptrexx"},
        {".tcsh", "text/x-scripttcsh"},
        {".zsh", "text/x-scriptzsh"},
        {".shtml", "text/x-server-parsed-html"},
        {".ssi", "text/x-server-parsed-html"},
        {".etx", "text/x-setext"},
        {".spc", "text/x-speech"},
        {".talk", "text/x-speech"},
        {".uil", "text/x-uil"},
        {".uu", "text/x-uuencode"},
        {".uue", "text/x-uuencode"},
        {".vcs", "text/x-vcalendar"},
        {".xml", "text/xml"},
        {".xsd", "text/xml"},
        {".xsl", "text/xml"},
        {".afl", "video/animaflex"},
        {".avs", "video/avs-video"},
        {".m1v", "video/mpeg"},
        {".m2v", "video/mpeg"},
        {".mpa", "video/mpeg"},
        {".mpe", "video/mpeg"},
        {".mpeg", "video/mpeg"},
        {".mpg", "video/mpeg"},
        {".moov", "video/quicktime"},
        {".mov", "video/quicktime"},
        {".qt", "video/quicktime"},
        {".vdo", "video/vdo"},
        {".rv", "video/vndrn-realvideo"},
        {".viv", "video/vndvivo"},
        {".vivo", "video/vndvivo"},
        {".vos", "video/vosaic"},
        {".xdr", "video/x-amt-demorun"},
        {".xsr", "video/x-amt-showrun"},
        {".fmf", "video/x-atomic3d-feature"},
        {".dl", "video/x-dl"},
        {".dif", "video/x-dv"},
        {".dv", "video/x-dv"},
        {".fli", "video/x-fli"},
        {".gl", "video/x-gl"},
        {".isu", "video/x-isvideo"},
        {".mjpg", "video/x-motion-jpeg"},
        {".asf", "video/x-ms-asf"},
        {".wmv", "video/x-ms-wmv"},
        {".avi", "video/x-msvideo"},
        {".qtc", "video/x-qtc"},
        {".scm", "video/x-scm"},
        {".movie", "video/x-sgi-movie"},
        {".mv", "video/x-sgi-movie"},
        {".wmf", "windows/metafile"},
        {".mime", "www/mime"},
        {".ice", "x-conference/x-cooltalk"},
        {".3dm", "x-world/x-3dmf"},
        {".3dmf", "x-world/x-3dmf"},
        {".qd3", "x-world/x-3dmf"},
        {".qd3d", "x-world/x-3dmf"},
        {".svr", "x-world/x-svr"},
        {".wrz", "x-world/x-vrml"},
        {".vrt", "x-world/x-vrt"},
        {".xgz", "xgl/drawing"},
        {".xmz", "xgl/movie"}};

    /**
     * @see org.opencms.setup.xml.I_CmsSetupXmlUpdate#getName()
     */
    public String getName() {

        return "Add mime types";
    }

    /**
     * @see org.opencms.setup.xml.I_CmsSetupXmlUpdate#getXmlFilename()
     */
    public String getXmlFilename() {

        return CmsVfsConfiguration.DEFAULT_XML_FILE_NAME;
    }

    /**
     * @see org.opencms.setup.xml.A_CmsSetupXmlUpdate#executeUpdate(org.dom4j.Document,
     *      java.lang.String)
     */
    protected boolean executeUpdate(Document document, String xpath) {

        Node node = document.selectSingleNode(xpath);
        if (node == null) {
            if (xpath.equals(getXPathsToUpdate().get(0))) {
                for (int i = 0; i < m_mimeTypes.length; i++) {
                    String mPath = xpath
                        + "/"
                        + CmsVfsConfiguration.N_MIMETYPE
                        + "[@"
                        + CmsVfsConfiguration.A_EXTENSION
                        + "=\""
                        + m_mimeTypes[i][0]
                        + "\"]";
                    CmsSetupXmlHelper.setValue(
                        document,
                        mPath + "/@" + CmsVfsConfiguration.A_EXTENSION,
                        m_mimeTypes[i][0]);
                    CmsSetupXmlHelper.setValue(
                        document,
                        mPath + "/@" + I_CmsXmlConfiguration.A_TYPE,
                        m_mimeTypes[i][1]);
                }
            }
            return true;
        }
        return false;
    }

    /**
     * @see org.opencms.setup.xml.A_CmsSetupXmlUpdate#getCommonPath()
     */
    protected String getCommonPath() {

        // /opencms/vfs/resources/mimetypes
        return new StringBuffer("/").append(CmsConfigurationManager.N_ROOT).append("/").append(
            CmsVfsConfiguration.N_VFS).append("/").append(CmsVfsConfiguration.N_RESOURCES).append("/").append(
            CmsVfsConfiguration.N_MIMETYPES).toString();
    }

    /**
     * @see org.opencms.setup.xml.A_CmsSetupXmlUpdate#getXPathsToUpdate()
     */
    protected List getXPathsToUpdate() {

        if (m_xpaths == null) {
            // /opencms/vfs/resources/mimetypes
            m_xpaths = Collections.singletonList(getCommonPath());
        }
        return m_xpaths;
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -