You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jclouds.apache.org by Jeremy Daggett <je...@RACKSPACE.COM> on 2014/04/21 19:39:04 UTC

Which MediaType?

Greetings,

How do others feel about using the Guava MediaType [1] class for MIME types instead of the (less robust) JAX-RS MediaType [2] throughout the codebase going forward?  We have discussed leveraging more of the Guava libraries, and I figured I would throw it out there. :)

/jd

[1] http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/net/MediaType.html
[2] http://docs.oracle.com/javaee/6/api/javax/ws/rs/core/MediaType.html



Re: Which MediaType?

Posted by Everett Toews <ev...@RACKSPACE.COM>.
On Apr 22, 2014, at 9:54 AM, Jeremy Daggett <je...@RACKSPACE.COM> wrote:

> I thought we had a coding best practices doc somewhere, but I can¹t seem
> to locate it. Any pointers? It would be good to capture any best practices
> like this for community members to reference.

Please start one on the wiki.

Everett

Re: Which MediaType?

Posted by Jeremy Daggett <je...@RACKSPACE.COM>.
Yes, indeed! We have also discussed it here:
https://github.com/jclouds/jclouds/pull/338

Using MediaType in BlobStore is just a first step, since it has to deal
with content types quite a bit. IMHO, all String representations of MIME
types should use this class. Tests, annotations, you name it.

I thought we had a coding best practices doc somewhere, but I can¹t seem
to locate it. Any pointers? It would be good to capture any best practices
like this for community members to reference.

/jd

On 4/22/14, 12:45 AM, "Andrew Phillips" <ap...@qrmedia.com> wrote:

>> How do others feel about using the Guava MediaType [1] class for
>> MIME types instead of the (less robust) JAX-RS MediaType [2]
>> throughout the codebase going forward?  We have discussed leveraging
>>  more of the Guava libraries, and I figured I would throw it out
>> there. :)
>
>See https://github.com/jclouds/jclouds/pull/44 - I believe gaul was
>thinking along your lines. Yes, definitely all for using MediaType in
>future, if we can figure out how to sensibly handle places where it's
>optional...
>
>ap


Re: Which MediaType?

Posted by Andrew Phillips <ap...@qrmedia.com>.
> How do others feel about using the Guava MediaType [1] class for   
> MIME types instead of the (less robust) JAX-RS MediaType [2]   
> throughout the codebase going forward?  We have discussed leveraging  
>  more of the Guava libraries, and I figured I would throw it out   
> there. :)

See https://github.com/jclouds/jclouds/pull/44 - I believe gaul was  
thinking along your lines. Yes, definitely all for using MediaType in  
future, if we can figure out how to sensibly handle places where it's  
optional...

ap