From ccf4103a25ccfc29d4621190e1df821d399bc929 Mon Sep 17 00:00:00 2001 From: Alessia Bardi Date: Wed, 25 Aug 2021 10:07:58 +0200 Subject: [PATCH] keep the original url if the decoder fails for any reason --- .../main/java/eu/dnetlib/dhp/oa/graph/raw/OafToOafMapper.java | 2 +- .../main/java/eu/dnetlib/dhp/oa/graph/raw/OdfToOafMapper.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/OafToOafMapper.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/OafToOafMapper.java index 5f9491029..b7afd3595 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/OafToOafMapper.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/OafToOafMapper.java @@ -169,7 +169,7 @@ public class OafToOafMapper extends AbstractMdRecordToOafMapper { .map(s -> { try { return URLDecoder.decode(s, "UTF-8"); - } catch (UnsupportedEncodingException e) { + } catch (Throwable t) { return s; } }) diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/OdfToOafMapper.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/OdfToOafMapper.java index 440dbaf6c..194715295 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/OdfToOafMapper.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/raw/OdfToOafMapper.java @@ -168,7 +168,7 @@ public class OdfToOafMapper extends AbstractMdRecordToOafMapper { protected String trimAndDecodeUrl(String url) { try { return URLDecoder.decode(url.trim(), "UTF-8"); - } catch (UnsupportedEncodingException e) { + } catch (Throwable t) { return url; } }