*/
private void validateSchemaWithFilepath(File schemaSourceFile, DataSchema schema)
{
if(schemaSourceFile != null && schemaSourceFile.isFile() && schema instanceof NamedDataSchema)
{
NamedDataSchema namedDataSchema = (NamedDataSchema)schema;
String namespace = namedDataSchema.getNamespace();
if(!removeFileExtension(schemaSourceFile.getName()).equalsIgnoreCase(namedDataSchema.getName()))
{
throw new IllegalArgumentException(namedDataSchema.getFullName() + " has name that does not match filename '" +
schemaSourceFile.getAbsolutePath() + "'");
}
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() + "'");
}
}
}