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 1314 - UniFileLoader.findPrimaryFile(FileObject) ought to check MIME type, not file extension.
Summary: UniFileLoader.findPrimaryFile(FileObject) ought to check MIME type, not file ...
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: All All
: P4 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1999-03-12 00:53 UTC by Jesse Glick
Modified: 2008-12-23 11:06 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 Jesse Glick 1999-03-12 00:53:41 UTC
IMHO, the default implementation in this class should accept a file object based on MIME type, not extension, using FileObject.getMIMEType(), so that e.g. an HTTP filesystem will work with these fil
es correctly--for example, an HTTP script http://foo.com/myscripts/gen_file.cgi may return Content-Type: text/html, but UniFileLoader would currently not recognize it.

Of course, a subclass of UniFileLoader could just override findPrimaryFile to do this right, but no one should have to do this--it should be the default.

Besides, if in Gandalf the loaders are exposed in the DataLoaderPool as Beans, a user would have to go and set the MIME types in each one separately, whereas I think this should be set with a Bean pro
perty editor on filesystems which need it (e.g. LocalFileSystem, JARFileSystem), or as a global IDE control panel (affecting FileUtil.[gs]etMIMEType())--then all the extensions would be visible in one
 place and the property editor could make sure that the same extension was not being used for more than one MIME type at once. At least, modules which use some non-default MIME type ought to install i
t with FileUtil.setMIMEType() in the module install method.
Comment 1 Quality Engineering 2003-07-01 15:51:24 UTC
Resolved for 3.4.x or earlier, no new info since then -> verified.

Comment 2 Quality Engineering 2003-07-01 16:16:28 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.