Skip to content

Commit

Permalink
fix: verrification des matches dans regex pour le status
Browse files Browse the repository at this point in the history
  • Loading branch information
slemaire777 committed Nov 3, 2023
1 parent 07a70ef commit b7ee3ac
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,13 @@ public TheseMappee(Mets mets, List<Set> oaiSets) {
final String regex = ".*\\/([0-9,A-Z]*)";
final String urlperene = mets.getDmdSec().stream().filter(d -> d.getMdWrap().getXmlData().getStarGestion() != null).findFirst().orElse(null)
.getMdWrap().getXmlData().getStarGestion().getTraitements().getSorties().getDiffusion().getUrlPerenne();
final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE);
final Matcher matcher = pattern.matcher(urlperene);
if (urlperene != null) {
final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE);
final Matcher matcher = pattern.matcher(urlperene);

if (isNnt(matcher.group(1))) {
status = "soutenue";
if (matcher.matches() && isNnt(matcher.group(1))) {
status = "soutenue";
}
}
} catch (NullPointerException e) {
log.error("PB pour status de " + nnt + "," + e.getMessage());
Expand Down

0 comments on commit b7ee3ac

Please sign in to comment.