use of org.mule.runtime.module.artifact.api.descriptor.ClassLoaderModel in project mule by mulesoft.
the class LibFolderClassLoaderModelLoader method load.
@Override
public ClassLoaderModel load(File artifactFile, Map<String, Object> attributes, ArtifactType artifactType) throws InvalidDescriptorLoaderException {
if (artifactFile == null || !artifactFile.exists()) {
throw new IllegalArgumentException("Service folder does not exists: " + (artifactFile != null ? artifactFile.getName() : null));
}
ClassLoaderModel.ClassLoaderModelBuilder classLoaderModelBuilder = new ClassLoaderModel.ClassLoaderModelBuilder();
classLoaderModelBuilder.containing(getUrl(artifactFile));
for (URL url : getServiceUrls(artifactFile)) {
classLoaderModelBuilder.containing(url);
}
return classLoaderModelBuilder.build();
}
Aggregations