Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 722D444CA for ; Mon, 11 Jul 2011 07:29:39 +0000 (UTC) Received: (qmail 30201 invoked by uid 500); 11 Jul 2011 07:29:35 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 30003 invoked by uid 500); 11 Jul 2011 07:29:21 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 29993 invoked by uid 99); 11 Jul 2011 07:29:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jul 2011 07:29:16 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jul 2011 07:29:14 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 067592388906 for ; Mon, 11 Jul 2011 07:28:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1145049 - /cxf/trunk/distribution/src/main/release/samples/jax_rs/basic/src/demo/jaxrs/client/Client.java Date: Mon, 11 Jul 2011 07:28:53 -0000 To: commits@cxf.apache.org From: ffang@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110711072854.067592388906@eris.apache.org> Author: ffang Date: Mon Jul 11 07:28:53 2011 New Revision: 1145049 URL: http://svn.apache.org/viewvc?rev=1145049&view=rev Log: [CXF-3650]jax-rs basic example doesn't work when there's a space in file path url Modified: cxf/trunk/distribution/src/main/release/samples/jax_rs/basic/src/demo/jaxrs/client/Client.java Modified: cxf/trunk/distribution/src/main/release/samples/jax_rs/basic/src/demo/jaxrs/client/Client.java URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/jax_rs/basic/src/demo/jaxrs/client/Client.java?rev=1145049&r1=1145048&r2=1145049&view=diff ============================================================================== --- cxf/trunk/distribution/src/main/release/samples/jax_rs/basic/src/demo/jaxrs/client/Client.java (original) +++ cxf/trunk/distribution/src/main/release/samples/jax_rs/basic/src/demo/jaxrs/client/Client.java Mon Jul 11 07:28:53 2011 @@ -31,6 +31,7 @@ import org.apache.commons.httpclient.met import org.apache.cxf.helpers.IOUtils; import org.apache.cxf.io.CachedOutputStream; +import org.apache.cxf.resource.URIResolver; public final class Client { @@ -64,7 +65,8 @@ public final class Client { System.out.println("Sent HTTP PUT request to update customer info"); Client client = new Client(); String inputFile = client.getClass().getResource("update_customer.xml").getFile(); - File input = new File(inputFile); + URIResolver resolver = new URIResolver(inputFile); + File input = new File(resolver.getURI()); PutMethod put = new PutMethod("http://localhost:9000/customerservice/customers"); RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1"); put.setRequestEntity(entity); @@ -85,7 +87,8 @@ public final class Client { System.out.println("\n"); System.out.println("Sent HTTP POST request to add customer"); inputFile = client.getClass().getResource("add_customer.xml").getFile(); - input = new File(inputFile); + resolver = new URIResolver(inputFile); + input = new File(resolver.getURI()); PostMethod post = new PostMethod("http://localhost:9000/customerservice/customers"); post.addRequestHeader("Accept" , "text/xml"); entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");