public static void validateURL ( String url , String controlGroup ) throws ValidationException { if ( ! ( controlGroup . equalsIgnoreCase ( "M" ) || controlGroup . equalsIgnoreCase ( "E" ) ) && url . startsWith ( "file:" ) ) { throw new ValidationException ( "Malformed URL (file: not allowed for control group " + controlGroup + ") " + url ) ; } try { new URL ( url ) ; } catch ( MalformedURLException e ) { if ( url . startsWith ( DatastreamManagedContent . UPLOADED_SCHEME ) ) { return ; } throw new ValidationException ( "Malformed URL: " + url , e ) ; } }
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 .