[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.rt] How to associate one or more content types based on something other than filename (URL protocol++)
|
Imagine I have a WebDAV server or something and a "file" I'd like to open
at:
webdav://server.com/path1/path2/foo
The "foo" filename is completely meaningless and doesn't tell me its content
type, but a HEAD call to the server would return the mime-type, which could
be converted to a content-type easily.
How do I hook into:
Platform.getContentTypeManager().findContentTypeFor(String) //(In this
case, string is a URL)
...so that when the String begins with "webdav:" I can provide some helper
that connects to the server and discovers the content type the right way and
returns it to the ContentTypeManager? The only hack/workaround I see is to
provide *lots* of content describers, all of which have to start parsing the
file contents because the filename/URL isn't even available to the
describer.