43 * <b>Mailcap file search order:</b><p> |
43 * <b>Mailcap file search order:</b><p> |
44 * The MailcapCommandMap looks in various places in the user's |
44 * The MailcapCommandMap looks in various places in the user's |
45 * system for mailcap file entries. When requests are made |
45 * system for mailcap file entries. When requests are made |
46 * to search for commands in the MailcapCommandMap, it searches |
46 * to search for commands in the MailcapCommandMap, it searches |
47 * mailcap files in the following order: |
47 * mailcap files in the following order: |
48 * <p> |
|
49 * <ol> |
48 * <ol> |
50 * <li> Programatically added entries to the MailcapCommandMap instance. |
49 * <li> Programatically added entries to the MailcapCommandMap instance. |
51 * <li> The file <code>.mailcap</code> in the user's home directory. |
50 * <li> The file {@code .mailcap} in the user's home directory. |
52 * <li> The file <<i>java.home</i>><code>/lib/mailcap</code>. |
51 * <li> The file {@literal <}<i>java.home</i>{@literal >}{@code /lib/mailcap}. |
53 * <li> The file or resources named <code>META-INF/mailcap</code>. |
52 * <li> The file or resources named {@code META-INF/mailcap}. |
54 * <li> The file or resource named <code>META-INF/mailcap.default</code> |
53 * <li> The file or resource named {@code META-INF/mailcap.default} |
55 * (usually found only in the <code>activation.jar</code> file). |
54 * (usually found only in the {@code activation.jar} file). |
56 * </ol> |
55 * </ol> |
57 * <p> |
56 * <p> |
58 * <b>Mailcap file format:</b><p> |
57 * <b>Mailcap file format:</b><p> |
59 * |
58 * |
60 * Mailcap files must conform to the mailcap |
59 * Mailcap files must conform to the mailcap |
68 * in mailcap files that allows JavaBeans(tm) components to be specified as |
67 * in mailcap files that allows JavaBeans(tm) components to be specified as |
69 * corresponding to particular commands for a MIME type.<p> |
68 * corresponding to particular commands for a MIME type.<p> |
70 * |
69 * |
71 * When a mailcap file is |
70 * When a mailcap file is |
72 * parsed, the MailcapCommandMap recognizes certain parameter signatures, |
71 * parsed, the MailcapCommandMap recognizes certain parameter signatures, |
73 * specifically those parameter names that begin with <code>x-java-</code>. |
72 * specifically those parameter names that begin with {@code x-java-}. |
74 * The MailcapCommandMap uses this signature to find |
73 * The MailcapCommandMap uses this signature to find |
75 * command entries for inclusion into its registries. |
74 * command entries for inclusion into its registries. |
76 * Parameter names with the form <code>x-java-<name></code> |
75 * Parameter names with the form {@code x-java-<name>} |
77 * are read by the MailcapCommandMap as identifying a command |
76 * are read by the MailcapCommandMap as identifying a command |
78 * with the name <i>name</i>. When the <i>name</i> is <code> |
77 * with the name <i>name</i>. When the <i>name</i> is {@code |
79 * content-handler</code> the MailcapCommandMap recognizes the class |
78 * content-handler} the MailcapCommandMap recognizes the class |
80 * signified by this parameter as a <i>DataContentHandler</i>. |
79 * signified by this parameter as a <i>DataContentHandler</i>. |
81 * All other commands are handled generically regardless of command |
80 * All other commands are handled generically regardless of command |
82 * name. The command implementation is specified by a fully qualified |
81 * name. The command implementation is specified by a fully qualified |
83 * class name of a JavaBean(tm) component. For example; a command for viewing |
82 * class name of a JavaBean(tm) component. For example; a command for viewing |
84 * some data can be specified as: <code>x-java-view=com.foo.ViewBean</code>.<p> |
83 * some data can be specified as: {@code x-java-view=com.foo.ViewBean}.<p> |
85 * |
84 * |
86 * When the command name is <code>fallback-entry</code>, the value of |
85 * When the command name is {@code fallback-entry}, the value of |
87 * the command may be <code>true</code> or <code>false</code>. An |
86 * the command may be {@code true} or {@code false}. An |
88 * entry for a MIME type that includes a parameter of |
87 * entry for a MIME type that includes a parameter of |
89 * <code>x-java-fallback-entry=true</code> defines fallback commands |
88 * {@code x-java-fallback-entry=true} defines fallback commands |
90 * for that MIME type that will only be used if no non-fallback entry |
89 * for that MIME type that will only be used if no non-fallback entry |
91 * can be found. For example, an entry of the form <code>text/*; ; |
90 * can be found. For example, an entry of the form {@code text/*; ; |
92 * x-java-fallback-entry=true; x-java-view=com.sun.TextViewer</code> |
91 * x-java-fallback-entry=true; x-java-view=com.sun.TextViewer} |
93 * specifies a view command to be used for any text MIME type. This |
92 * specifies a view command to be used for any text MIME type. This |
94 * view command would only be used if a non-fallback view command for |
93 * view command would only be used if a non-fallback view command for |
95 * the MIME type could not be found.<p> |
94 * the MIME type could not be found.<p> |
96 * |
95 * |
97 * MailcapCommandMap aware mailcap files have the |
96 * MailcapCommandMap aware mailcap files have the |
98 * following general form:<p> |
97 * following general form: |
99 * <code> |
98 * <pre>{@code |
100 * # Comments begin with a '#' and continue to the end of the line.<br> |
99 * # Comments begin with a '#' and continue to the end of the line. |
101 * <mime type>; ; <parameter list><br> |
100 * <mime type>; ; <parameter list> |
102 * # Where a parameter list consists of one or more parameters,<br> |
101 * # Where a parameter list consists of one or more parameters, |
103 * # where parameters look like: x-java-view=com.sun.TextViewer<br> |
102 * # where parameters look like: x-java-view=com.sun.TextViewer |
104 * # and a parameter list looks like: <br> |
103 * # and a parameter list looks like: |
105 * text/plain; ; x-java-view=com.sun.TextViewer; x-java-edit=com.sun.TextEdit |
104 * text/plain; ; x-java-view=com.sun.TextViewer; x-java-edit=com.sun.TextEdit |
106 * <br> |
105 * # Note that mailcap entries that do not contain 'x-java' parameters |
107 * # Note that mailcap entries that do not contain 'x-java' parameters<br> |
106 * # and comply to RFC 1524 are simply ignored: |
108 * # and comply to RFC 1524 are simply ignored:<br> |
107 * image/gif; /usr/dt/bin/sdtimage %s |
109 * image/gif; /usr/dt/bin/sdtimage %s<br> |
108 * }</pre> |
110 * |
|
111 * </code> |
|
112 * <p> |
|
113 * |
109 * |
114 * @author Bart Calder |
110 * @author Bart Calder |
115 * @author Bill Shannon |
111 * @author Bill Shannon |
116 * |
112 * |
117 * @since 1.6 |
113 * @since 1.6 |