📄 mailcapcommandmap.html
字号:
<!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 Thu Jan 17 03:51:30 PST 2002 -->
<TITLE>
Java 2 Platform EE v1.3: Class MailcapCommandMap
</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> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../javax/activation/FileTypeMap.html"><B>PREV CLASS</B></A>
<A HREF="../../javax/activation/MimeType.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="MailcapCommandMap.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.activation</FONT>
<BR>
Class MailcapCommandMap</H2>
<PRE>
java.lang.Object
|
+--<A HREF="../../javax/activation/CommandMap.html">javax.activation.CommandMap</A>
|
+--<B>javax.activation.MailcapCommandMap</B>
</PRE>
<HR>
<DL>
<DT>public class <B>MailcapCommandMap</B><DT>extends <A HREF="../../javax/activation/CommandMap.html">CommandMap</A></DL>
<P>
MailcapCommandMap extends the CommandMap
abstract class. It implements a CommandMap whose configuration
is based on mailcap files (RFC 1524). The MailcapCommandMap can
be configured both programmatically and via configuration
files.
<p>
<b>Mailcap file search order:</b><p>
The MailcapCommandMap looks in various places in the user's
system for mailcap file entries. When requests are made
to search for commands in the MailcapCommandMap, it searches
mailcap files in the following order:
<p>
<ol>
<li> Programatically added entries to the MailcapCommandMap instance.
<li> The file <code>.mailcap</code> in the user's home directory.
<li> The file <<i>java.home</i>><code>/lib/mailcap</code>.
<li> The file or resource named <code>META-INF/mailcap</code>.
<li> The file or resource named <code>META-INF/mailcap.default</code>
(usually found only in the <code>activation.jar</code> file).
</ol>
<p>
<b>Mailcap file format:</b><p>
Mailcap files must conform to the mailcap
file specification (RFC 1524, <i>A User Agent Configuration Mechanism
For Multimedia Mail Format Information</i>).
The file format consists of entries corresponding to
particular MIME types. In general, the specification
specifies <i>applications</i> for clients to use when they
themselves cannot operate on the specified MIME type. The
MailcapCommandMap extends this specification by using a parameter mechanism
in mailcap files that allows JavaBeans(tm) components to be specified as
corresponding to particular commands for a MIME type.<p>
When a mailcap file is
parsed, the MailcapCommandMap recognizes certain parameter signatures,
specifically those parameter names that begin with <code>x-java-</code>.
The MailcapCommandMap uses this signature to find
command entries for inclusion into its registries.
Parameter names with the form <code>x-java-<name></code>
are read by the MailcapCommandMap as identifying a command
with the name <i>name</i>. When the <i>name</i> is <code>
content-handler</code> the MailcapCommandMap recognizes the class
signified by this parameter as a <i>DataContentHandler</i>.
All other commands are handled generically regardless of command
name. The command implementation is specified by a fully qualified
class name of a JavaBean(tm) component. For example; a command for viewing
some data can be specified as: <code>x-java-view=com.foo.ViewBean</code>.<p>
MailcapCommandMap aware mailcap files have the
following general form:<p>
<code>
# Comments begin with a '#' and continue to the end of the line.<br>
<mime type>; ; <parameter list><br>
# Where a parameter list consists of one or more parameters,<br>
# where parameters look like: x-java-view=com.sun.TextViewer<br>
# and a parameter list looks like: <br>
text/plain; ; x-java-view=com.sun.TextViewer; x-java-edit=com.sun.TextEdit
<br>
# Note that mailcap entries that do not contain 'x-java' parameters<br>
# and comply to RFC 1524 are simply ignored:<br>
image/gif; /usr/dt/bin/sdtimage %s<br>
</code>
<p>
<P>
<HR>
<P>
<!-- ======== INNER CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== 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="../../javax/activation/MailcapCommandMap.html#MailcapCommandMap()">MailcapCommandMap</A></B>()</CODE>
<BR>
The default Constructor.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../javax/activation/MailcapCommandMap.html#MailcapCommandMap(java.io.InputStream)">MailcapCommandMap</A></B>(java.io.InputStream is)</CODE>
<BR>
Constructor that allows the caller to specify an <i>InputStream</i>
containing a mailcap file.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../javax/activation/MailcapCommandMap.html#MailcapCommandMap(java.lang.String)">MailcapCommandMap</A></B>(java.lang.String fileName)</CODE>
<BR>
Constructor that allows the caller to specify the path
of a <i>mailcap</i> file.</TD>
</TR>
</TABLE>
<!-- ========== 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> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/activation/MailcapCommandMap.html#addMailcap(java.lang.String)">addMailcap</A></B>(java.lang.String mail_cap)</CODE>
<BR>
Add entries to the registry.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/activation/DataContentHandler.html">DataContentHandler</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/activation/MailcapCommandMap.html#createDataContentHandler(java.lang.String)">createDataContentHandler</A></B>(java.lang.String mimeType)</CODE>
<BR>
Return the DataContentHandler for the specified MIME type.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/activation/CommandInfo.html">CommandInfo</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/activation/MailcapCommandMap.html#getAllCommands(java.lang.String)">getAllCommands</A></B>(java.lang.String mimeType)</CODE>
<BR>
Get all the available commands in all mailcap files known to
this instance of MailcapCommandMap for this MIME type.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/activation/CommandInfo.html">CommandInfo</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/activation/MailcapCommandMap.html#getCommand(java.lang.String, java.lang.String)">getCommand</A></B>(java.lang.String mimeType,
java.lang.String cmdName)</CODE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -