org.fcrepo.server.validation
Class ValidationUtility

java.lang.Object
  extended by org.fcrepo.server.validation.ValidationUtility

public abstract class ValidationUtility
extends Object

Misc validation-related functions.

Version:
$Id$
Author:
Chris Wilper, Edwin Shin

Constructor Summary
ValidationUtility()
           
 
Method Summary
static void setFeslPolicyParser(PolicyParser parser)
           
static void setPolicyParser(PolicyParser parser)
          Sets the policy parser to be used to validate "POLICY" datastream.
static void setValidateFeslPolicy(boolean validate)
           
static void validateReservedDatastream(PID pid, String dsId, Datastream ds)
          Validates the given datastream if it's a reserved datastream.
static void validateReservedDatastreams(DOReader reader)
          Validates the latest version of all reserved datastreams in the given object.
static void validateURL(String url, String controlGroup)
          Validates the candidate URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationUtility

public ValidationUtility()
Method Detail

validateURL

public static void validateURL(String url,
                               String controlGroup)
                        throws ValidationException
Validates the candidate URL. The result of the validation also depends on the control group of the datastream in question. Managed datastreams may be ingested using the file URI scheme, other datastreams may not.

Parameters:
url - The URL to validate.
controlGroup - The control group of the datastream the URL belongs to.
Throws:
ValidationException - if the URL is malformed.

setPolicyParser

public static void setPolicyParser(PolicyParser parser)
Sets the policy parser to be used to validate "POLICY" datastream. NOTE: This must be set before attempting to validate POLICY datastreams. Otherwise, a runtime exception will be thrown.

Parameters:
parser - the parser to use.

setFeslPolicyParser

public static void setFeslPolicyParser(PolicyParser parser)

setValidateFeslPolicy

public static void setValidateFeslPolicy(boolean validate)

validateReservedDatastreams

public static void validateReservedDatastreams(DOReader reader)
                                        throws ValidationException
Validates the latest version of all reserved datastreams in the given object.

Throws:
ValidationException

validateReservedDatastream

public static void validateReservedDatastream(PID pid,
                                              String dsId,
                                              Datastream ds)
                                       throws ValidationException
Validates the given datastream if it's a reserved datastream. The given stream is guaranteed to be closed when this method completes.

Throws:
ValidationException


Copyright © 2012 DuraSpace. All Rights Reserved.