Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #31340 > unrolled thread
| Started by | Philipp Kraus <philipp.kraus@flashpixx.de> |
|---|---|
| First post | 2015-03-20 23:02 +0100 |
| Last post | 2015-03-23 19:27 -0400 |
| Articles | 4 — 3 participants |
Back to article view | Back to comp.lang.java.programmer
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
| From | Philipp Kraus <philipp.kraus@flashpixx.de> |
|---|---|
| Date | 2015-03-20 23:02 +0100 |
| Subject | mimetype |
| 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]
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Date | 2015-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]
| From | Philipp Kraus <philipp.kraus@flashpixx.de> |
|---|---|
| Date | 2015-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]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2015-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