This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: getting the JDK built-in web server to set the correct mime type


Hi Per,

(sorry, this bounced from the mailing list so resending as plain text)

Thanks for fixing this, and sorry for not replying earlier, I seem to
have missed this email.

I see that you've committed this change to SVN. Unfortunately I think
there's a minor error, as I'm still getting invalid mime type when
browsing files using IE.

I believe lines 426-428 in Path.java should be

        if (contentType == null) {
            contentType = URLConnection.guessContentTypeFromName(getPath());
        }

rather than

        if (contentType != null) {
            contentType = URLConnection.guessContentTypeFromName(getPath());
        }

After making this change, the mime type seems to be detected correctly.

thanks,
Alex

On Thu, Aug 1, 2013 at 2:09 PM, Per Bothner <per@bothner.com> wrote:
> I've been thinking about the API for MIMI detection,
> and I think it's reasonable to support getNPath for all
> gnu.text.Path object s- but sometimes an exception is thrown
> if there is no matching FileSystemProvider.  Instead, the
> caller (in this case KawaAutoHandler) can catch the exception.
>
> So I wrote the attached patch.
>
> Sorry for procrastinating while deciding on the API.
>
> --
>         --Per Bothner
> per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]