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 181809 - Allow file types to have any IANA's permitted MIME Media Types
Summary: Allow file types to have any IANA's permitted MIME Media Types
Status: RESOLVED DUPLICATE of bug 181285
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-10 21:29 UTC by andreluizferreirapinto
Modified: 2010-03-11 15:22 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andreluizferreirapinto 2010-03-10 21:29:45 UTC
When creating a new file type, it's necessary to specify a MIME type.
NetBeans allow one to use, for example:

text/x-myformat

but not:

text/x-my-format (notice the extra hyphen)

It says that is "Not a valid MIME type.". However, if someone searches in the official IANA's list of MIME Media Types at http://www.iana.org/assignments/media-types/, one can see MIME types such:

text/xml-external-parsed-entity

at http://www.iana.org/assignments/media-types/text/, standardized by RFC3023 (http://www.rfc-editor.org/rfc/rfc3023.txt).

Since one cannot create a new file type with a MIME type like the one above, this bug clearly limits NetBeans' capacity of recognizing existing file types - as well the creation of new ones with this characteristic -, hence the choice to assign to P2 priority (Critical usability problem).
Comment 1 Jaroslav Tulach 2010-03-11 03:54:36 UTC
Jesse, here is the test. I don't feel skilled enough to fix the regexp.

diff -r 1c8906e41ba0 apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/ui/wizard/loader/FileRecognitionPanelTest.java
--- a/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/ui/wizard/loader/FileRecognitionPanelTest.java   Thu Mar 11 10:47:08 2010 +0100
+++ b/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/ui/wizard/loader/FileRecognitionPanelTest.java   Thu Mar 11 10:54:56 2010 +0100
@@ -59,6 +59,10 @@
         assertValidity(Result.VALID, "text/docbook+xml", "whatever", "", true);
         assertValidity(Result.VALID, "text/x-docbook+xml", "whatever", "", true);
     }
+    public void testCheckValidityBug181809() throws Exception {
+        assertValidity(Result.VALID, "text/x-my-format", "", "mfmt", false);
+    }
+
     enum Result {VALID, INFO, ERROR}
     private static void assertValidity(Result expected, String mimeType, String namespace, String extension, boolean byElement) {
         AtomicBoolean error = new AtomicBoolean();
Comment 2 Jesse Glick 2010-03-11 07:41:39 UTC
Trivial workaround - pick a different MIME type, then search & replace in sources afterwards.
Comment 3 Jesse Glick 2010-03-11 15:22:15 UTC

*** This bug has been marked as a duplicate of bug 181285 ***