Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id F1EA5200B5A for ; Thu, 30 Jun 2016 00:44:02 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id F0CA9160A79; Wed, 29 Jun 2016 22:44:02 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id AC763160A7D for ; Thu, 30 Jun 2016 00:44:01 +0200 (CEST) Received: (qmail 27067 invoked by uid 500); 29 Jun 2016 22:44:00 -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 25320 invoked by uid 99); 29 Jun 2016 22:43:59 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jun 2016 22:43:59 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 80F70E963C; Wed, 29 Jun 2016 22:43:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: reta@apache.org To: commits@cxf.apache.org Date: Wed, 29 Jun 2016 22:44:28 -0000 Message-Id: <8560d7a2ea9e4f26a43c3b2f20d08361@git.apache.org> In-Reply-To: <4bcfaade3ee3407db49b6439dc67ac16@git.apache.org> References: <4bcfaade3ee3407db49b6439dc67ac16@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [30/48] cxf git commit: Updating the services list formatters to drop SOAP or REST text if no relevant endpoints exist archived-at: Wed, 29 Jun 2016 22:44:03 -0000 Updating the services list formatters to drop SOAP or REST text if no relevant endpoints exist Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6ba5249f Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6ba5249f Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6ba5249f Branch: refs/heads/master-jaxrs-2.1 Commit: 6ba5249f2e42bf5e95652cd580556acbf6fb4fd9 Parents: 0eafb7f Author: Sergey Beryozkin Authored: Mon Jun 27 12:03:08 2016 +0100 Committer: Sergey Beryozkin Committed: Mon Jun 27 12:03:08 2016 +0100 ---------------------------------------------------------------------- .../servlet/servicelist/FormattedServiceListWriter.java | 8 ++++++-- .../servlet/servicelist/UnformattedServiceListWriter.java | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/6ba5249f/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java ---------------------------------------------------------------------- diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java index c26b43f..7903f86 100644 --- a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java +++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java @@ -62,8 +62,12 @@ public class FormattedServiceListWriter implements ServiceListWriter { writer.write(""); if (soapDestinations.length > 0 || restDestinations.length > 0) { - writeSOAPEndpoints(writer, basePath, soapDestinations); - writeRESTfulEndpoints(writer, basePath, restDestinations); + if (soapDestinations.length > 0) { + writeSOAPEndpoints(writer, basePath, soapDestinations); + } + if (restDestinations.length > 0) { + writeRESTfulEndpoints(writer, basePath, restDestinations); + } } else { writer.write("No services have been found."); } http://git-wip-us.apache.org/repos/asf/cxf/blob/6ba5249f/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java ---------------------------------------------------------------------- diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java index d5a5e2c..5650c92 100644 --- a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java +++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java @@ -36,12 +36,16 @@ public class UnformattedServiceListWriter implements ServiceListWriter { } public void writeServiceList(PrintWriter writer, - String baseAddress, + String basePath, AbstractDestination[] soapDestinations, AbstractDestination[] restDestinations) throws IOException { if (soapDestinations.length > 0 || restDestinations.length > 0) { - writeUnformattedSOAPEndpoints(writer, baseAddress, soapDestinations); - writeUnformattedRESTfulEndpoints(writer, baseAddress, restDestinations); + if (soapDestinations.length > 0) { + writeUnformattedSOAPEndpoints(writer, basePath, soapDestinations); + } + if (restDestinations.length > 0) { + writeUnformattedRESTfulEndpoints(writer, basePath, restDestinations); + } } else { writer.write("No services have been found."); }