in src/main/java/org/apache/sling/installer/factory/model/impl/InstallFeatureModelTask.java [253:280]
private ArtifactProvider getLocalArtifactProvider() {
// TODO share with addArtifact()
return new ArtifactProvider() {
@Override
public URL provide(ArtifactId id) {
File artifactFile = (installContext.storageDirectory == null ? null
: getArtifactFile(installContext.storageDirectory, id));
ArtifactHandler handler;
if (artifactFile == null || !artifactFile.exists()) {
try {
handler = installContext.artifactManager.getArtifactHandler(id.toMvnUrl());
} catch (final IOException ignore) {
return null;
}
} else {
try {
handler = new ArtifactHandler(artifactFile);
} catch (final MalformedURLException e) {
return null;
}
}
if (handler == null) {
return null;
}
return handler.getLocalURL();
}
};
}