Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4A073D8DE for ; Mon, 1 Oct 2012 18:45:11 +0000 (UTC) Received: (qmail 6846 invoked by uid 500); 1 Oct 2012 18:45:10 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 6808 invoked by uid 500); 1 Oct 2012 18:45:10 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 6758 invoked by uid 99); 1 Oct 2012 18:45:10 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Oct 2012 18:45:10 +0000 Date: Tue, 2 Oct 2012 05:45:10 +1100 (NCT) From: "Gary D. Gregory (JIRA)" To: dev@hc.apache.org Message-ID: <1603462868.149563.1349117110144.JavaMail.jiratomcat@arcas> In-Reply-To: <1006831657.149525.1349116988797.JavaMail.jiratomcat@arcas> Subject: [jira] [Resolved] (HTTPCORE-314) Add org.apache.http.entity.ContentType.withCharset(Charset) and String APIs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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