Commit 205fedd7 authored by Matt Wise's avatar Matt Wise
Browse files

Revert "Revert "add OSDU record id validation check function""

This reverts commit 61cc3311.
parent d21a1c79
Pipeline #29567 passed with stages
in 2 minutes and 16 seconds
......@@ -140,6 +140,22 @@ public class Record {
//Check format and tenant
if (!Record.isRecordIdValidFormatAndTenant(recordId, tenant))
return false;
return true;
* Checks if a RecordId has a valid format and matches the specified tenant and kind
* @param recordId
* @param tenant
* @param kind
* @return
public static boolean isOsduRecordIdValid(String recordId, String tenant, String kind) {
//Check format and tenant
if (!isRecordIdValid(recordId, tenant, kind))
return false;
//id should be split by colons. ex: tenant:groupType--individualType:uniqueId
......@@ -149,6 +165,10 @@ public class Record {
String[] kindSplitByColon = kind.split(":");
String kindSubType = kindSplitByColon[2]; //grab GroupType/IndividualType
if (!recordIdSplitByColon[1].equalsIgnoreCase(kindSubType))
return false;
return true;
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment