hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HTTPCORE-314) Add org.apache.http.entity.ContentType.withCharset(Charset) and String APIs
Date Tue, 27 Nov 2012 14:53:58 GMT

     [ https://issues.apache.org/jira/browse/HTTPCORE-314?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oleg Kalnichevski updated HTTPCORE-314:
---------------------------------------

    Fix Version/s:     (was: 4.3)
                   4.3-alpha2
    
> Add org.apache.http.entity.ContentType.withCharset(Charset) and String APIs
> ---------------------------------------------------------------------------
>
>                 Key: HTTPCORE-314
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-314
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore
>         Environment: Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
> Maven home: C:\Java\apache-maven-3.0.4\bin\..
> Java version: 1.6.0_35, vendor: Sun Microsystems Inc.
> Java home: C:\Program Files\Java\jdk1.6.0_35\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
>            Reporter: Gary Gregory
>             Fix For: 4.3-alpha2
>
>
> A {{ContentType}} is immutable.
> Before 4.2, you wrote code like this:
> {code:java}
> final Charset myCharset = ...
> final ContentType ct = ContentType.create(HTTP.OCTET_STREAM_TYPE, myCharset);
> {code:java}
> {{HTTP.OCTET_STREAM_TYPE}} is deprecated in 4.2. 
> In order to avoid magic strings in the code I can do:
> {code:java}
> final ContentType ct = ContentType.create(ContentType.APPLICATION_OCTET_STREAM.getMimeType(),
myCharset);
> {code}
> This issue allows the fluent style to be applied:
> {code:java
> final ContentType ct = ContentType.APPLICATION_OCTET_STREAM.withCharset(myCharset);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


Mime
View raw message