This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 31509

Summary: Request helper methods to find less specific MIME types
Product: platform Reporter: Jesse Glick <jglick>
Component: -- Other --Assignee: issues@platform <issues>
Status: RESOLVED WONTFIX    
Severity: blocker CC: dstrupl
Priority: P2 Keywords: API
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 16389, 31223    

Description Jesse Glick 2003-02-26 17:13:12 UTC
Suggest:

/**
 * Find progressively less specific MIME type
variants.
 * Given a MIME type such as
"text/ant+xml;charset=UTF-8" it might
 * produce:
 * <ul>
 * <li><code>text/ant+xml;charset=UTF-8</code></li>
 * <li><code>text/ant+xml</code></li>
 * <li><code>text/xml</code></li>
 * <li><code>text/*</code></li>
 * <li><code>content/unknown</code></li>
 * </ul>
 * May be useful e.g. for finding suitable editor
kits for a file.
 * @param a fully-specified MIME type
 * @return a read-only iterator of MIME type
strings based on that,
 *         from most to least specific
 */
public static Iterator
Utilities.mimeTypeDefaults(String mt);

/**
 * Find progressively less specific MIME type variants
 * as folder-like names suitable for JNDI lookup.
 * Given a MIME type such as
"text/ant+xml;charset=UTF-8" it might
 * produce:
 * <ul>
 * <li><code>text/xml/ant/</code></li>
 * <li><code>text/xml/</code></li>
 * <li><code>text/</code></li>
 * <li>(the empty string)</li>
 * </ul>
 * May be useful e.g. for finding some settings
for a file
 * based on its MIME type, with the possibility to
use defaults.
 * @param a fully-specified MIME type
 * @return a read-only iterator of contexts based
on that,
 *         from most to least specific
 */
public static Iterator
Utilities.mimeTypeContexts(String mt);
Comment 1 Jesse Glick 2006-07-20 05:35:38 UTC
Handled by MIME Lookup API.