protected Library createLibrary(SearchState state, LoadServiceResource resource) { if (resource == null) { return null; } String file = resource.getName(); String location = state.loadName; if (file.endsWith(".so") || file.endsWith(".dll") || file.endsWith(".bundle")) { if (runtime.getInstanceConfig().isCextEnabled()) { return new CExtension(resource); } else { throw runtime.newLoadError("C extensions are disabled, can't load `" + resource.getName() + "'", resource.getName()); } } else if (file.endsWith(".jar")) { return new JarredScript(resource); } else if (file.endsWith(".class")) { return new JavaCompiledScript(resource); } else { return new ExternalScript(resource, location); } }
protected Library createLibrary(SearchState state, LoadServiceResource resource) { if (resource == null) { return null; } String file = resource.getName(); String location = state.loadName; if (file.endsWith(".so") || file.endsWith(".dll") || file.endsWith(".bundle")) { if (runtime.getInstanceConfig().isCextEnabled()) { return new CExtension(resource); } else { throw runtime.newLoadError("C extensions are disabled, can't load `" + resource.getName() + "'", resource.getName()); } } else if (file.endsWith(".jar")) { return new JarredScript(resource); } else if (file.endsWith(".class")) { return new JavaCompiledScript(resource); } else { return new ExternalScript(resource, location); } }