Skip to content

Commit 2f63dc8

Browse files
committed
added default providing isOverride()
1 parent d2ac0bc commit 2f63dc8

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

core/src/main/java/org/bouncycastle/util/Properties.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,32 @@ public static boolean isOverrideSet(String propertyName)
4848
}
4949
}
5050

51+
/**
52+
* Return whether a particular override has been set to true.
53+
*
54+
* @param propertyName the property name for the override.
55+
* @return true if the property is set to "true", false otherwise.
56+
*/
57+
public static boolean isOverrideSet(String propertyName, boolean defIsTrue)
58+
{
59+
try
60+
{
61+
String value = getPropertyValue(propertyName);
62+
if (value == null)
63+
{
64+
return defIsTrue;
65+
}
66+
else
67+
{
68+
return isSetTrue(value);
69+
}
70+
}
71+
catch (AccessControlException e)
72+
{
73+
return false;
74+
}
75+
}
76+
5177
/**
5278
* Return whether a particular override has been set to false.
5379
*

0 commit comments

Comments
 (0)