This repository has been archived by the owner on Nov 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add description, lastUpdatedTime, and lastUpdatedBy to secrets
Signed-off-by: Eamonn Mansour <47121388+eamansour@users.noreply.github.com>
- Loading branch information
Showing
36 changed files
with
1,058 additions
and
325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...common/src/main/java/dev/galasa/framework/api/common/resources/BaseResourceValidator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright contributors to the Galasa project | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package dev.galasa.framework.api.common.resources; | ||
|
||
/** | ||
* A base validator class that contains commonly-used validation methods | ||
*/ | ||
public class BaseResourceValidator { | ||
|
||
/** | ||
* Checks whether a given string is in valid Latin-1 format (e.g. characters in the range 0 - 255) | ||
* | ||
* @param str the string to validate | ||
* @return true if the string is in valid Latin-1 format, or false otherwise | ||
*/ | ||
public boolean isLatin1(String str) { | ||
boolean isValidLatin1 = true; | ||
for (char i = 0; i < str.length(); i++) { | ||
if (str.charAt(i) > 255) { | ||
isValidLatin1 = false; | ||
break; | ||
} | ||
} | ||
return isValidLatin1; | ||
} | ||
|
||
/** | ||
* Checks whether a given string contains only alphanumeric characters, '-', and '_' | ||
* | ||
* @param str the string to validate | ||
* @return true if the string contains only alphanumeric characters, '-', and '_', or false otherwise | ||
*/ | ||
public boolean isAlphanumWithDashes(String str) { | ||
boolean isValid = true; | ||
for (char c : str.toCharArray()) { | ||
if (!Character.isLetterOrDigit(c) && c != '-' && c != '_') { | ||
isValid = false; | ||
break; | ||
} | ||
} | ||
return isValid; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.