turbinemimetypeservice.html

来自「turbine教程」· HTML 代码 · 共 695 行 · 第 1/3 页

HTML
695
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Fri Dec 06 19:57:08 CET 2002 --><TITLE>jakarta-turbine-2 2.2 API: Class  TurbineMimeTypeService</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/TurbineMimeTypeService.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../../../org/apache/turbine/services/mimetype/TurbineMimeTypes.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="TurbineMimeTypeService.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">org.apache.turbine.services.mimetype</FONT><BR>Class  TurbineMimeTypeService</H2><PRE>java.lang.Object  |  +--<A HREF="../../../../../org/apache/turbine/services/BaseInitable.html">org.apache.turbine.services.BaseInitable</A>        |        +--<A HREF="../../../../../org/apache/turbine/services/BaseService.html">org.apache.turbine.services.BaseService</A>              |              +--<A HREF="../../../../../org/apache/turbine/services/TurbineBaseService.html">org.apache.turbine.services.TurbineBaseService</A>                    |                    +--<B>org.apache.turbine.services.mimetype.TurbineMimeTypeService</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../../org/apache/turbine/services/Initable.html">Initable</A>, <A HREF="../../../../../org/apache/turbine/services/mimetype/MimeTypeService.html">MimeTypeService</A>, <A HREF="../../../../../org/apache/turbine/services/Service.html">Service</A></DD></DL><HR><DL><DT>public class <B>TurbineMimeTypeService</B><DT>extends <A HREF="../../../../../org/apache/turbine/services/TurbineBaseService.html">TurbineBaseService</A><DT>implements <A HREF="../../../../../org/apache/turbine/services/mimetype/MimeTypeService.html">MimeTypeService</A></DL><P>The MimeType Service maintains mappings between MIME types and the corresponding file name extensions, and between locales and character encodings. <p>The MIME type mappings can be defined in MIME type files located in user's home directory, Java home directory or the current class jar. The default mapping file is defined with the mime.type.file property. In addition, the service maintains a set of most common mappings. <p>The charset mappings can be defined in property files located in user's home directory, Java home directory or the current class jar. The default mapping file is defined with the charset.file property. In addition, the service maintains a set of most common mappings.<P><DL><DT><B>Version: </B><DD>$Id: TurbineMimeTypeService.java,v 1.3 2002/04/16 22:07:08 kschrader Exp $</DD><DT><B>Author: </B><DD><a href="mailto:ilkka.priha@simsoft.fi">Ilkka Priha</a></DD></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/services/mimetype/TurbineMimeTypeService.html#CHARSETS">CHARSETS</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The charset file property.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/services/mimetype/TurbineMimeTypeService.html#MIME_TYPES">MIME_TYPES</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The MIME type file property.</TD></TR></TABLE>&nbsp;<A NAME="fields_inherited_from_class_org.apache.turbine.services.BaseService"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from class org.apache.turbine.services.<A HREF="../../../../../org/apache/turbine/services/BaseService.html">BaseService</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../../../org/apache/turbine/services/BaseService.html#configuration">configuration</A>, <A HREF="../../../../../org/apache/turbine/services/BaseService.html#name">name</A>, <A HREF="../../../../../org/apache/turbine/services/BaseService.html#properties">properties</A>, <A HREF="../../../../../org/apache/turbine/services/BaseService.html#serviceBroker">serviceBroker</A></CODE></TD></TR></TABLE>&nbsp;<A NAME="fields_inherited_from_class_org.apache.turbine.services.BaseInitable"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from class org.apache.turbine.services.<A HREF="../../../../../org/apache/turbine/services/BaseInitable.html">BaseInitable</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../../../org/apache/turbine/services/BaseInitable.html#initableBroker">initableBroker</A>, <A HREF="../../../../../org/apache/turbine/services/BaseInitable.html#isInitialized">isInitialized</A></CODE></TD></TR></TABLE>&nbsp;<A NAME="fields_inherited_from_class_org.apache.turbine.services.mimetype.MimeTypeService"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from interface org.apache.turbine.services.mimetype.<A HREF="../../../../../org/apache/turbine/services/mimetype/MimeTypeService.html">MimeTypeService</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../../../org/apache/turbine/services/mimetype/MimeTypeService.html#SERVICE_NAME">SERVICE_NAME</A></CODE></TD></TR></TABLE>&nbsp;<!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../../org/apache/turbine/services/mimetype/TurbineMimeTypeService.html#TurbineMimeTypeService()">TurbineMimeTypeService</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a new service.</TD></TR></TABLE>&nbsp;<!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/services/mimetype/TurbineMimeTypeService.html#getCharSet(java.util.Locale)">getCharSet</A></B>(java.util.Locale&nbsp;locale)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the charset for a locale.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/services/mimetype/TurbineMimeTypeService.html#getCharSet(java.util.Locale, java.lang.String)">getCharSet</A></B>(java.util.Locale&nbsp;locale,           java.lang.String&nbsp;variant)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the charset for a locale with a variant.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/services/mimetype/TurbineMimeTypeService.html#getCharSet(java.lang.String)">getCharSet</A></B>(java.lang.String&nbsp;key)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the charset for a specified key.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/services/mimetype/TurbineMimeTypeService.html#getCharSet(java.lang.String, java.lang.String)">getCharSet</A></B>(java.lang.String&nbsp;key,           java.lang.String&nbsp;def)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the charset for a specified key.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/services/mimetype/TurbineMimeTypeService.html#getContentType(java.io.File)">getContentType</A></B>(java.io.File&nbsp;file)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the MIME content type for a file as a string.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/services/mimetype/TurbineMimeTypeService.html#getContentType(java.lang.String)">getContentType</A></B>(java.lang.String&nbsp;name)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the MIME content type for a named file as a string.</TD></TR>

⌨️ 快捷键说明

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