You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Gary D. Gregory (JIRA)" <ji...@apache.org> on 2012/10/01 20:43:08 UTC

[jira] [Created] (HTTPCORE-314) Add org.apache.http.entity.ContentType.withCharset(Charset) and String APIs

Gary D. Gregory created HTTPCORE-314:
----------------------------------------

             Summary: 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 D. Gregory
             Fix For: 4.3


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


[jira] [Resolved] (HTTPCORE-314) Add org.apache.http.entity.ContentType.withCharset(Charset) and String APIs

Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-314?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory resolved HTTPCORE-314.
--------------------------------------

    Resolution: Fixed

commit -m "[HTTPCORE-314] Add org.apache.http.entity.ContentType.withCharset(Charset) and String APIs." C:/svn/org/apache/httpcomponents/trunk/httpcore/httpcore/src/main/java/org/apache/http/entity/ContentType.java C:/svn/org/apache/httpcomponents/trunk/httpcore/httpcore/src/test/java/org/apache/http/entity/TestContentType.java
    Sending        C:/svn/org/apache/httpcomponents/trunk/httpcore/httpcore/src/main/java/org/apache/http/entity/ContentType.java
    Sending        C:/svn/org/apache/httpcomponents/trunk/httpcore/httpcore/src/test/java/org/apache/http/entity/TestContentType.java
    Transmitting file data ...
    Committed revision 1392511.

                
> 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 D. Gregory
>             Fix For: 4.3
>
>
> 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


[jira] [Updated] (HTTPCORE-314) Add org.apache.http.entity.ContentType.withCharset(Charset) and String APIs

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
     [ 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