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 243971 - Can we have Mime types extensions that are defined by the end user
Summary: Can we have Mime types extensions that are defined by the end user
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-21 18:12 UTC by ngx472
Modified: 2014-04-26 07:59 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
SQL Mime Type Resolver java source file (1.83 KB, text/x-java-source)
2014-04-21 18:12 UTC, ngx472
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ngx472 2014-04-21 18:12:52 UTC
Created attachment 146863 [details]
SQL Mime Type Resolver java source file

I do an SQL Editor Platform Application
Up until 7.2, I managed the SQL mime type through the SQLMimeResolver.java file attached together with layer.xml snippet which looks like this:

<folder name="MIMEResolver">
      <file name="com-sqlbrowser-module-sqlsupport-dataobject-SQLMimeResolver.instance">
        <attr name="instanceCreate" methodvalue="com.sqlbrowser.module.sqlsupport.dataobject.SQLMimeResolver.getInstance"/>
      </file>
</folder>

The interest of doing so was to have user defined extensions matching the SQL file type (Prefs.getSQLFileExtensions())

Since 8.0, The Action "File / Open" throws a Mime Type Exception

I removed my reference in the layer to my Java Mime Type handler in favor of the annotation based approach, which defines extensions as hard coded developer chosen extensions

I was wondering if having the file extensions discovered at run time would be feasible

Thanks
Comment 1 Jaroslav Havlin 2014-04-22 07:16:15 UTC
Have you tried registering your resolver using ServiceProvider?

Excerpt from javadoc:
> In the rarely case, when declarative resolvers are not sufficient, you can 
> register subclass of MIMEResolver directly by using ServiceProvider annotation.

I'm sorry, I haven't tried your code, so I don't know what exception is exactly thrown, but the ServiceProvider should be worth trying.
Comment 2 ngx472 2014-04-26 07:59:27 UTC
Thanks, worked exactly