接口/枚举列出标准的MIME类型常量 [英] Interface/enum listing standard mime-type constants

查看:248
本文介绍了接口/枚举列出标准的MIME类型常量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找标准库(如apache commons,jax,jboss,javax)之间的接口或列举所有标准mime类型(又称内容类型)值的枚举。

I am looking among the standard libraries (like apache commons, jax, jboss, javax) for an interface or enum that lists the values of all the standard mime-type (aka content-type).

这个接口不应该与其他类太深入,以至于很难将整个包作为gwt源代码。

This interface should not be encumbered with too deep with other classes that would make it difficult to include the whole bunch as gwt source code.

例如

interface ContentType{
  String JSON = "Application/JSON";
  blah ... blah ...
}

或者, p>

or,

enum ContentType{
  JSON("Application/JSON"),
  blah ... blah ...
}


推荐答案

番石榴课程: com.google.common.net.MediaType

它与Guava 12一起发布,如源代码中所述代码和问题823 来源可用,也是。

It was released with Guava 12 as stated in the source code and in Issue 823. Sources are available, too.

这篇关于接口/枚举列出标准的MIME类型常量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆