* @param expectedUri Uri
*/
public void validate(String expectedUri) {
if (objectUri == null)
throw new ObjectValidationFailedException
(expectedUri, Messages.message
(NodePermission.class.getName() + ".nullObjectUri"));
if (!objectUri.equals(expectedUri)) {
// extra test to make "/files/x" == "/files/x/"
String tmpObjectUri=objectUri;
if (tmpObjectUri.endsWith("/"))
tmpObjectUri=tmpObjectUri.substring(0,tmpObjectUri.length()-1);
String tmpExpectedUri=expectedUri;
if (tmpExpectedUri.endsWith("/"))
tmpExpectedUri=tmpExpectedUri.substring(0,tmpExpectedUri.length()-1);
if (!tmpObjectUri.equals(tmpExpectedUri))
throw new ObjectValidationFailedException
(expectedUri, Messages.message
(NodePermission.class.getName() + ".incorrectObjectUri"));
}
if (subjectUri == null)
throw new ObjectValidationFailedException
(expectedUri, Messages.message
(NodePermission.class.getName() + ".nullSubjectUri"));
if (actionUri == null)
throw new ObjectValidationFailedException
(expectedUri, Messages.message
(NodePermission.class.getName() + ".nullActionUri"));
}