Bug 153202 - Add API for programmatic way to add new extension for interested mime-type
Add API for programmatic way to add new extension for interested mime-type
Status: VERIFIED FIXED
Product: platform
Classification: Unclassified
Component: Filesystems
6.x
All All
: P2 (vote)
: 6.x
Assigned To: Jiri Skrivanek
issues@platform
: API, API_REVIEW_FAST
Depends on:
Blocks: 153204
  Show dependency treegraph
 
Reported: 2008-11-14 09:40 UTC by Jiri Skrivanek
Modified: 2011-12-12 13:19 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
FileUtil patch. (39.75 KB, text/plain)
2008-11-26 09:13 UTC, Jiri Skrivanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2008-11-14 09:40:12 UTC
There should exists a possibility to programatically add an extension to be recognized as certain MIME type. Now it is
achievable only in Tools > Options > Miscellaneous > Files.
Comment 1 Jiri Skrivanek 2008-11-26 09:12:36 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.
Comment 2 Jiri Skrivanek 2008-11-26 09:13:47 UTC
Created attachment 74162 [details]
FileUtil patch.
Comment 3 Vladimir Voskresensky 2008-11-29 19:08:21 UTC
VV1: We need support not only for adding new extension to be recognized as C++ file, but removing as well. 
Comment 4 Jiri Skrivanek 2008-12-01 07:29:53 UTC
> 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.
Comment 5 Vladimir Voskresensky 2008-12-01 08:53:22 UTC
if this info in javadoc and apichanges => I'm fine with it
Thanks
Comment 6 Jiri Skrivanek 2008-12-01 11:53:48 UTC
It is in javadoc, I will add it to apichanges.
Comment 7 Jesse Glick 2008-12-01 17:06:16 UTC
"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.
Comment 8 Jiri Skrivanek 2008-12-03 08:09:32 UTC
If there are no other complains, it will be integrated to 7.0M2.
Comment 9 Jiri Skrivanek 2008-12-19 09:24:17 UTC
Implemented.
http://hg.netbeans.org/core-main/rev/fe4dc8c2623f
Comment 10 Quality Engineering 2008-12-22 15:11:07 UTC
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.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo