Is there any way to generate content type headers from file extensions in Java?

I have a Java application that sometimes has to be changed from a file list to a content - type header Is there any way to estimate the content types of common extensions? (e.g. "PDF" mapped to "application / PDF", etc.)

Solution

Yes, urlconnection This is what guisscontenttypefromname does

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>