Le jeudi 10 f�vrier 2005 � 12:00 +0100, Erik Bruchez a �crit :
> Eric van der Vlist wrote:
> 
> >      1. That would be nice if the URL generator could rely on the media
> >         type given by the OS for local files. For instance, if I read
> >         a .swx file and that my OS is configured correctly, the URL
> >         generator could guess that the media type is
> >         "application/vnd.sun.xml.writer".
> 
> Is there a standard mechanism in Java to get the media type of a file 
> from the OS? 

I don't know how accurate it is, but there is the sun.net.www.MimeTable
class. I am using it in the ArchiveConverter on which I am working.

> With URLConnection, you can get information based on the 
> content-type header if there is one, or based on content (fairly poorly 
> implemented in the JDK last time I checked).

Yes.

> Note that the URL generator may access resources from a URLConnection, 
> or directly from the Resource Manager (who may access files directly, 
> for example).

Sure, that was my case here.

Eric
-- 
Carnet web :
           http://eric.van-der-vlist.com/blog?t=category&a=Fran%C3%A7ais
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------



-------------------------------------------------------
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_ide95&alloc_id396&op=click
_______________________________________________
orbeon-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/orbeon-user

Reply via email to