[Java lista] Mimetype detection

Zidarics Zoltan zamek at vili.pmmf.hu
2006. Dec. 30., Szo, 11:32:55 CET


hello,
Kozben megtalaltam a megoldast, az archivum kedveert:
A regi activation-1.0.2 helyett activation-1.1 hasznalata.
Ez az alabbi helyeken keresi a mime.types nevu file-t:

   1.  The file .mime.types in the user's home directory.
   2. The file <java.home>/lib/mime.types.
   3. The file or resources named META-INF/mime.types.
   4. The file or resource named META-INF/mimetypes.default (usually found 
only in the activation.jar file). 

(a sorrendben nem vagyok bizonyos, mert tobb forrast talaltam, nemelyik 
eloszor keresi a java.home-ban, aztan a user home-ban, a jar-t meg lusta 
voltam disassemblalni) 

Az msoffice-hoz:
application/vnd.ms-excel xls xlt xlm xld xla xlc xlw xll
application/vnd.ms-powerpoint ppt pps
application/msword doc

a pdf-hez:
application/pdf pdf

az openoffice-hoz:
application/vnd.sun.xml.writer sxw
application/vnd.sun.xml.writer.template stw
application/vnd.sun.xml.writer.global sxg
application/vnd.stardivision.writer sdw vor
application/vnd.stardivision.writer-global sgl
application/vnd.sun.xml.calc sxc
application/vnd.sun.xml.calc.template stc
application/vnd.stardivision.calc sdc
application/vnd.sun.xml.impress sxi
application/vnd.sun.xml.impress.template sti
application/vnd.stardivision.impress sdd sdp
application/vnd.sun.xml.draw sxd
application/vnd.sun.xml.draw.template std
application/vnd.stardivision.draw sda
application/vnd.sun.xml.math sxm
application/vnd.stardivision.math smf
application/vnd.oasis.opendocument.text odt
application/vnd.oasis.opendocument.text-template ott
application/vnd.oasis.opendocument.text-web oth
application/vnd.oasis.opendocument.text-master odm
application/vnd.oasis.opendocument.graphics odg
application/vnd.oasis.opendocument.graphics-template otg
application/vnd.oasis.opendocument.presentation odp
application/vnd.oasis.opendocument.presentation-template otp
application/vnd.oasis.opendocument.spreadsheet ods
application/vnd.oasis.opendocument.spreadsheet-template ots
application/vnd.oasis.opendocument.chart odc
application/vnd.oasis.opendocument.formula odf
application/vnd.oasis.opendocument.database odb
application/vnd.oasis.opendocument.image odi

ezek a bejegyzesek tartoznak

2006. december 29. 19.42 dátummal Zidarics Zoltan ezt írta:
> Egy egyszeru servlet file kiszolgalo alkalmazasnak a content type-ot is
> szolgaltatnia kell a file-hoz. A javax.activation.MimetypesFileTypeMap
> segitsegevel probalom kideriteni ezt az infot. Elhulten tapasztalom, hogy
> pl. a pdf, openoffice, MSOffice file-ok content type-jat nem jol adja
> vissza.
>
> Termeszetesen gyalog drotozassal megoldottam, de a kerdes adodik, hogy van
> ennek valami szabvanyos modja, vagy esetleg rossz uton probalom meg
> kideriteni a content type-ot?

udv,
-- 
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694


További információk a(z) Javalist levelezőlistáról