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

查看:26
本文介绍了接口/枚举列出标准 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 ...
}

或者,

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

推荐答案

Guava

我们有一个 Guava 类:com.google.common.net.MediaType.

如源代码和 问题 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天全站免登陆