}
return Collections.emptyList();
} else {
// .pks are handled as a special case.
InputStream is = null;
KnowledgePackageImp kpkg = null;
try {
is = resource.getInputStream();
Object object = DroolsStreamUtils.streamIn( is );
if ( object instanceof KnowledgePackageImp ) {
kpkg = ((KnowledgePackageImp) object);
} else {
kpkg = new KnowledgePackageImp( (Package) object );
}
for ( Rule rule : kpkg.pkg.getRules() ) {
rule.setResource( resource );
}