DevFaqMIMEResolver

How can I create declarative MIMEResolver and add new file type?

There is a wizard available for NetBeans modules which does this for you. Just run New File | Module Development | File Type. Fill in the MIME Type text field and choose whether to recognize file by extension or XML root element. If you want more sophisticated recognition, choose "by Filename Extension" and edit created resolver xml after you finish the wizard. In the next step type in "Class Name Prefix" your preferred prefix and finish the wizard.

Description of declarative MIME resolve can be found in this document. In most cases it should be enough to resolve files only by their extensions as the wizard does (see ext element). Other types of resolution can be more time expensive, so use them only exceptionally. Useful can be file name matching, file content matching or magic matching for binary files. Also consider existence of exit element intended for negative matching which can skips next conditions.


  Applies to: NetBeans 6.1+, pattern and name elements to 6.7+
  Related:  DevFaqFileRecognition
Not logged in. Log in, Register

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