Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,20 @@ private void validateNode(ClusterNodeDefinition node) {
}
}

public static String stripQuotes(String value) {
if (value == null || value.isEmpty())
return value;

int start = 0;
int end = value.length();
private static String stripQuotes(String value) {
if (value == null)
return null;
value = value.trim();

if (value.charAt(0) == '"' || value.charAt(0) == '\'') {
start++;
while (!value.isEmpty() && (value.startsWith("\"") || value.startsWith("'"))) {
value = value.substring(1).trim();
}
if (value.length() > 1 &&
(value.charAt(value.length() - 1) == '"' || value.charAt(value.length() - 1) == '\'')) {
end--;

while (!value.isEmpty() && (value.endsWith("\"") || value.endsWith("'"))) {
value = value.substring(0, value.length() - 1).trim();
}

return value.substring(start, end);
return value;
}

public static String getContainerizationFlavor(String envVarsScript) {
Expand Down
Loading