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.
Summary: | Add API for programmatic way to add new extension for interested mime-type | ||
---|---|---|---|
Product: | platform | Reporter: | Jiri Skrivanek <jskrivanek> |
Component: | Filesystems | Assignee: | Jiri Skrivanek <jskrivanek> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | apireviews, vv159170 |
Priority: | P2 | Keywords: | API, API_REVIEW_FAST |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 153204 | ||
Attachments: | FileUtil patch. |
Description
Jiri Skrivanek
2008-11-14 09:40:12 UTC
Please, review changes in FileUtil. Method FileUtil.setMIMEType(String extension, String mimeType) was un-deprecated. New implementation persistently registers file extension for specified MIME type. It is stored in userdir/config/Services/MIMEResolver. From previous implementation is kept the fact that files with the xml extension are by default resolved as text/xml MIME type even no MIMEResolver is registered. Also added method FileUtil.getMIMETypeExtensions(String mimeType) to get list of file extensions associated with specified MIME type. Created attachment 74162 [details]
FileUtil patch.
VV1: We need support not only for adding new extension to be recognized as C++ file, but removing as well. > VV1: We need support not only for adding new extension to be recognized as C++ file, but removing as well.
For example FileUtil.setMIMEType("mycpp", null) deregisters the mycpp extension.
if this info in javadoc and apichanges => I'm fine with it Thanks It is in javadoc, I will add it to apichanges. "It is in javadoc, I will add it to apichanges." - all details about an API should be kept in the Javadoc. apichanges.xml entries should be short and describe only what has changed, in the case of an existing API; or in the case of a new API, give a very brief summary of its purpose. An apichanges entry exists so that a reader can decide whether the change is relevant to their application, but Javadoc must be read to actually use the API. If there are no other complains, it will be integrated to 7.0M2. Implemented. http://hg.netbeans.org/core-main/rev/fe4dc8c2623f Integrated into 'main-golden', will be available in build *200812221122* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/fe4dc8c2623f User: Jiri Skrivanek <jskrivanek@netbeans.org> Log: #153202 - Method FileUtil.setMIMEType(String extension, String mimeType) resurrected to register file extension for specified MIME type. It is persisted in userdir contrary to previous implementation. Added method FileUtil.getMIMETypeExtensions(String mimeType) to get list of file extensions associated with specified MIME type. |