private void validateSchemaWithFilePath ( File schemaSourceFile , DataSchema schema ) { if ( schemaSourceFile != null && schemaSourceFile . isFile ( ) && schema instanceof NamedDataSchema ) { final NamedDataSchema namedDataSchema = ( NamedDataSchema ) schema ; final String namespace = namedDataSchema . getNamespace ( ) ; if ( ! FileUtil . removeFileExtension ( schemaSourceFile . getName ( ) ) . equalsIgnoreCase ( namedDataSchema . getName ( ) ) ) { throw new IllegalArgumentException ( namedDataSchema . getFullName ( ) + " has name that does not match filename '" + schemaSourceFile . getAbsolutePath ( ) + "'" ) ; } final String directory = schemaSourceFile . getParentFile ( ) . getAbsolutePath ( ) ; if ( ! directory . endsWith ( namespace . replace ( ' ' , File . separatorChar ) ) ) { throw new IllegalArgumentException ( namedDataSchema . getFullName ( ) + " has namespace that does not match " + "file path '" + schemaSourceFile . getAbsolutePath ( ) + "'" ) ; } } }
Checks that the schema name and namespace match the file name and path . These must match for FileDataSchemaResolver to find a schema pdscs by fully qualified name .