Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #31340 > unrolled thread

mimetype

Started byPhilipp Kraus <philipp.kraus@flashpixx.de>
First post2015-03-20 23:02 +0100
Last post2015-03-23 19:27 -0400
Articles 4 — 3 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  mimetype Philipp Kraus <philipp.kraus@flashpixx.de> - 2015-03-20 23:02 +0100
    Re: mimetype Arne Vajhøj <arne@vajhoej.dk> - 2015-03-21 22:03 -0400
      Re: mimetype Philipp Kraus <philipp.kraus@flashpixx.de> - 2015-03-22 10:35 +0100
        Re: mimetype Jeff Higgins <jeff@invalid.invalid> - 2015-03-23 19:27 -0400

#31340 — mimetype

FromPhilipp Kraus <philipp.kraus@flashpixx.de>
Date2015-03-20 23:02 +0100
Subjectmimetype
Message-ID<meht37$264h$1@ariadne.rz.tu-clausthal.de>
Hello,

I try to get the mimetype of an URL. My URL points to 
file://.../file.css or *.js or *.htm, I use this call to get the 
mimetye:

URLConnection.guessContentTypeFromName( l_physicalfile.toString() );

but on *.css or *.js file I get a null / empty value. I'm using Java 
1.8, so how can I get the mimetype for my files?

Thanks

Phil

[toc] | [next] | [standalone]


#31345

FromArne Vajhøj <arne@vajhoej.dk>
Date2015-03-21 22:03 -0400
Message-ID<550e2306$0$289$14726298@news.sunsite.dk>
In reply to#31340
On 3/20/2015 6:02 PM, Philipp Kraus wrote:
> I try to get the mimetype of an URL. My URL points to
> file://.../file.css or *.js or *.htm, I use this call to get the mimetye:
>
> URLConnection.guessContentTypeFromName( l_physicalfile.toString() );
>
> but on *.css or *.js file I get a null / empty value. I'm using Java
> 1.8, so how can I get the mimetype for my files?

Couple of suggestions:

1) Find a more reliable method.  :-)

2) Edit jre lib content-types.properties to have all the types you need.

Arne


[toc] | [prev] | [next] | [standalone]


#31346

FromPhilipp Kraus <philipp.kraus@flashpixx.de>
Date2015-03-22 10:35 +0100
Message-ID<melpt7$pm9$1@ariadne.rz.tu-clausthal.de>
In reply to#31345

[Multipart message — attachments visible in raw view] — view raw

On 2015-03-22 02:03:50 +0000, Arne Vajhøj said:

> On 3/20/2015 6:02 PM, Philipp Kraus wrote:
>> I try to get the mimetype of an URL. My URL points to
>> file://.../file.css or *.js or *.htm, I use this call to get the mimetye:
>> 
>> URLConnection.guessContentTypeFromName( l_physicalfile.toString() );
>> 
>> but on *.css or *.js file I get a null / empty value. I'm using Java
>> 1.8, so how can I get the mimetype for my files?
> 
> Couple of suggestions:
> 
> 1) Find a more reliable method.  :-)
> 
> 2) Edit jre lib content-types.properties to have all the types you need.

I'm using https://sourceforge.net/projects/mime-util/ 
at the moment exists only some types, which are not correct defined

Phil

[toc] | [prev] | [next] | [standalone]


#31355

FromJeff Higgins <jeff@invalid.invalid>
Date2015-03-23 19:27 -0400
Message-ID<meq7gm$f28$1@dont-email.me>
In reply to#31346
On 03/22/2015 05:35 AM, Philipp Kraus wrote:
> On 2015-03-22 02:03:50 +0000, Arne Vajhøj said:
>
>
> On 3/20/2015 6:02 PM, Philipp Kraus wrote:
>
> I try to get the mimetype of an URL. My URL points to
>
> file://.../file.css or *.js or *.htm, I use this call to get the mimetye:
>
>
> URLConnection.guessContentTypeFromName( l_physicalfile.toString() );
>
>
> but on *.css or *.js file I get a null / empty value. I'm using Java
>
> 1.8, so how can I get the mimetype for my files?
>
>
> Couple of suggestions:
>
>
> 1) Find a more reliable method.:-)
>
>
> 2) Edit jre lib content-types.properties to have all the types you need.
>
>
> I'm using https://sourceforge.net/projects/mime-util/
>
> at the moment exists only some types, which are not correct defined
>
>
I'm guessing this a moment different from the moment of you're original 
post.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web