File tree 1 file changed +16
-3
lines changed
core/repository/manager/src/main/java/org/eclipse/rdf4j/repository/manager 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -276,9 +276,9 @@ public synchronized RepositoryConfig getRepositoryConfig(String id) {
276
276
throw new RepositoryConfigException ("Wrong repository ID in configuration: " + configFile );
277
277
}
278
278
var config = RepositoryConfigUtil .getRepositoryConfig (model , repositoryID );
279
- if (Configurations .hasLegacyConfiguration (model ) && !Configurations .useLegacyConfig ()) {
280
- logger . warn ( "configuration for {} uses legacy vocabulary, converting." , id );
281
- addRepositoryConfig (config );
279
+ if (Configurations .hasLegacyConfiguration (model ) && !Configurations .useLegacyConfig ()
280
+ && config != null ) {
281
+ migrateToNewConfigVocabulary (config );
282
282
}
283
283
return config ;
284
284
} catch (IOException e ) {
@@ -288,6 +288,19 @@ public synchronized RepositoryConfig getRepositoryConfig(String id) {
288
288
return null ;
289
289
}
290
290
291
+ /**
292
+ * Migrate a repository configuration from the legacy vocabulary to the new vocabulary in
293
+ * {@link org.eclipse.rdf4j.model.vocabulary.CONFIG}.
294
+ * <p>
295
+ * Override this method to provide custom migration logic.
296
+ *
297
+ * @param config
298
+ */
299
+ protected void migrateToNewConfigVocabulary (RepositoryConfig config ) {
300
+ logger .warn ("Configuration for {} uses legacy vocabulary, converting." , config .getID ());
301
+ addRepositoryConfig (config );
302
+ }
303
+
291
304
@ Override
292
305
public RepositoryInfo getRepositoryInfo (String id ) {
293
306
RepositoryConfig config = getRepositoryConfig (id );
You can’t perform that action at this time.
0 commit comments