|
From: Matt S. <sga...@us...> - 2005-03-04 19:33:32
|
Sounds reasonable to me. You should probably add an enhancement request
to JIRA.
Matt
Andy Depue wrote:
> Well, actually, here is what I was thinking. Say that I pull a resource from
> a file or classpath (file: or classpath: or even just a relative path).
> Then, sure, just figure out the mime type based on file extension when I call
> "getMimeType" (or whatever) against the Resource. That at least saves me the
> trouble of parsing the filename or calling into the activation framework.
> BUT, if I pass in a URL to a resource where the mime type is handled
> independently of the filename (such as a "http:" URL, where the server will
> return a type header), then return the specific mime type that was returned
> by the server. See URL.openConnection().getContentType(). A simple
> algorithm could be:
>
> getMimeType() {
> return URL.openConnection().getContentType() if not null,
> otherwise parse filename/use activation framework.
> }
>
> - Andy
>
> On Friday 04 March 2005 07:01 am, Matt Sgarlata wrote:
>
>>OK, I see what you're getting at now. The problem is, how do you want
>>Spring to figure out the mime type if it's not based on file extension?
>> By dynamically inspecting the contents of the file at runtime? I know
>>that's possible because IE does it, but that seems like it would be a
>>pain to implement. Is there some other approach you could take, like
>>storing the mime type information external to the file itself?
>>
>>Matt
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
|