From 3fa93fd3d11c0f6a4c8e885476ba611947a6f2b7 Mon Sep 17 00:00:00 2001 From: "piotr.gawron" <piotr.gawron@uni-new> Date: Fri, 23 Sep 2016 10:25:59 +0200 Subject: [PATCH] fix on drugbank web changes --- .../annotation/services/DrugbankHTMLParser.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/DrugbankHTMLParser.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/DrugbankHTMLParser.java index af30076168..9239e2cecc 100644 --- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/DrugbankHTMLParser.java +++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/DrugbankHTMLParser.java @@ -197,8 +197,12 @@ public class DrugbankHTMLParser extends DrugAnnotation implements IExternalServi String description = webpageContent.substring(startIndex, endIndex); // find special html characters description = StringEscapeUtils.unescapeHtml4(description); + description = cleanHtml(description); + if (description.equalsIgnoreCase("Not Available")) { + description = null; + } - return cleanHtml(description); + return description; } /** @@ -390,9 +394,8 @@ public class DrugbankHTMLParser extends DrugAnnotation implements IExternalServi * @throws DrugSearchException * thrown when there are problems with connection to DrugBank * database - * @return - * drug with the information abtained from drugbank or - * <code>null</code> if such data couldn't be found + * @return drug with the information abtained from drugbank or + * <code>null</code> if such data couldn't be found */ private Drug findMoreInformation(String name) throws DrugSearchException { Drug result = null; -- GitLab