From 149d04299208163ebebcb4c10fe6f93975271493 Mon Sep 17 00:00:00 2001 From: Sasha Sherstnev Date: Thu, 12 Sep 2013 09:33:25 +0100 Subject: [PATCH] Fix "formard" compatibility problem with the list of web-services in the client --- webservices/compbio/ws/client/Jws2Client.java | 4 ++-- webservices/compbio/ws/client/Services.java | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/webservices/compbio/ws/client/Jws2Client.java b/webservices/compbio/ws/client/Jws2Client.java index 3c62c29..0991e0f 100644 --- a/webservices/compbio/ws/client/Jws2Client.java +++ b/webservices/compbio/ws/client/Jws2Client.java @@ -232,8 +232,8 @@ public class Jws2Client { throws WebServiceException, IOException { Set services = Jws2Client.getServices(hostname); if (!services.isEmpty()) { - System.out.println("Supported services are: " - + Services.toString(services)); + System.out.println("There are " + services.size() + " available services at " + hostname + ":"); + System.out.print("The list of services:\n" + Services.toString(services)); } else { System.out.println("Failed to connect to the registry! "); } diff --git a/webservices/compbio/ws/client/Services.java b/webservices/compbio/ws/client/Services.java index 2ffafb6..e5a937f 100644 --- a/webservices/compbio/ws/client/Services.java +++ b/webservices/compbio/ws/client/Services.java @@ -58,14 +58,16 @@ public enum Services { public static String toString(Set services) { if (services == null || services.isEmpty()) { - return ""; + return "No known services...\n"; } String value = ""; - String delim = ", "; for (Services serv : services) { - value += serv.toString() + delim; + if (null != serv) { + value += serv + "\n"; + } else { + value += "Unknown Service\n"; + } } - value = value.substring(0, value.length() - delim.length()); return value; } -- 1.7.10.2