MCPcopy Create free account
hub / github.com/Fedict/dcattools / isValidIRI

Method isValidIRI

tools/src/main/java/be/gov/data/tools/EDP.java:1077–1091  ·  view source on GitHub ↗
(IRI iri)

Source from the content-addressed store, hash-verified

1075 }
1076
1077 private static boolean isValidIRI(IRI iri) {
1078 String str = iri.stringValue();
1079 if (str.startsWith("https://") || str.startsWith("http://") || str.startsWith("ftp://")) {
1080 return str.contains(".") && !str.contains(" ") && str.length() > 10;
1081 }
1082
1083 if (str.startsWith("mailto:")) {
1084 return str.contains("@") && str.contains(".") && !str.contains(" ") && str.length() > 13;
1085 }
1086
1087 if (str.startsWith("tel:")) {
1088 return str.length() > 5;
1089 }
1090 return false;
1091 }
1092
1093 /**
1094 * Check if syntax of URLs / mailto IRI are valid, remove the statement if this isn't the case

Callers 1

checkAllIRIsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected