{
String publicId = entity.getPublicId();
String systemId = entity.getSystemId();
String value = null;
InputSource source = null;
ReadStream is = null;
if (_entityResolver != null)
source = _entityResolver.resolveEntity(publicId, systemId);
if (source != null && source.getByteStream() != null)
is = Vfs.openRead(source.getByteStream());
else if (source != null && source.getCharacterStream() != null)
is = Vfs.openRead(source.getCharacterStream());
else if (source != null && source.getSystemId() != null &&
_searchPath.lookup(source.getSystemId()).isFile()) {
_owner.addDepend(_searchPath.lookup(source.getSystemId()));
is = _searchPath.lookup(source.getSystemId()).openRead();
}
else if (systemId != null && ! systemId.equals("")) {
String path = systemId;
if (path.startsWith("file:"))
path = path.substring(5);
if (_searchPath != null && _searchPath.lookup(path).isFile()) {
_owner.addDepend(_searchPath.lookup(path));
is = _searchPath.lookup(path).openRead();
}
}
if (is == null)
return false;
_filename = systemId;
_systemId = systemId;
Path oldSearchPath = _searchPath;
Path path = is.getPath();
if (path != null) {
_owner.addDepend(path);
if (_searchPath != null) {
_searchPath = path.getParent();