hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Creating a ContentType
Date Mon, 01 Oct 2012 15:39:18 GMT
On Mon, 2012-10-01 at 09:17 -0400, Gary Gregory wrote:
> Hi All:
> 
> Right now I have code that looks like this:
> 
>   final Charset myCharset = ...
>   final ContentType ct = ContentType.create(*HTTP.OCTET_STREAM_TYPE*,
> myCharset);
> 
> HTTP.OCTET_STREAM_TYPE is deprecated, so to avoild magic strings in the
> code I can do:
> 
>   final ContentType ct =
> ContentType.create(ContentType.APPLICATION_OCTET_STREAM.getMimeType(),
> myCharset);
> 
> What doing a fluent type of call instead:
> 
> final ContentType ct = ContentType.APPLICATION_OCTET_STREAM.with(myCharset);
> 
> ?
> 

Sounds good to me. +1

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message