if (fEntityResolver != null) {
fXSDDescription.reset();
fXSDDescription.setValues(null, loc, null, null);
XMLInputSource xis = null;
try {
xis = fEntityResolver.resolveEntity(fXSDDescription);
} catch (IOException ex) {
fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
"schema_reference.4",
new Object[] { loc }, XMLErrorReporter.SEVERITY_ERROR);
}
if (xis == null) {
// REVISIT: can this happen?
// Treat value as a URI and pass in as systemId
return new XMLInputSource(null, loc, null);
}
return xis;
}
} else if (val instanceof InputSource) {
return saxToXMLInputSource((InputSource) val);
} else if (val instanceof InputStream) {
return new XMLInputSource(null, null, null,
(InputStream) val, null);
} else if (val instanceof File) {
File file = (File) val;
InputStream is = null;
try {
is = new BufferedInputStream(new FileInputStream(file));
} catch (FileNotFoundException ex) {
fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
"schema_reference.4", new Object[] { file.toString() },
XMLErrorReporter.SEVERITY_ERROR);
}
return new XMLInputSource(null, null, null, is, null);
}
throw new XMLConfigurationException(
XMLConfigurationException.NOT_SUPPORTED, "\""+JAXP_SCHEMA_SOURCE+
"\" property cannot have a value of type {"+val.getClass().getName()+
"}. Possible types of the value supported are String, File, InputStream, "+