Refactoring code

This commit is contained in:
luca.frosini 2023-07-13 10:45:06 +02:00
parent 97263ef698
commit 32ea336e31
1 changed files with 3 additions and 4 deletions

View File

@ -73,10 +73,9 @@ public abstract class Record extends CKANPackage {
public static final String TIMESERIES_ELEMENT_FILENAME_PROPERTY = "filename";
public static final String TIMESERIES_MIMETYPE = "text/csv";
public static final String TYPE_QUERY_FILTER_KEY = "extras_systemtype";
protected static final String TYPE_QUERY_FILTER_KEY = "extras_systemtype";
public static final Pattern tagPattern = Pattern.compile("[^\\s\\w-_]");
public static final Pattern TAG_PATTERN = Pattern.compile("[^\\s\\w-_]");
protected UriInfo uriInfo;
@ -130,7 +129,7 @@ public abstract class Record extends CKANPackage {
ArrayNode tags = (ArrayNode) jsonNode.get(Record.TAGS_PROPERTY);
for(JsonNode tag : tags) {
String t = tag.get(Record.NAME_PROPERTY).asText();
Matcher tagMatcher = Record.tagPattern.matcher(t);
Matcher tagMatcher = Record.TAG_PATTERN.matcher(t);
String newT = tagMatcher.replaceAll("");
((ObjectNode)tag).replace(Record.NAME_PROPERTY, new TextNode(newT));
}