File tree Expand file tree Collapse file tree
core/repository/manager/src/main/java/org/eclipse/rdf4j/repository/manager Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -276,9 +276,9 @@ public synchronized RepositoryConfig getRepositoryConfig(String id) {
276276 throw new RepositoryConfigException ("Wrong repository ID in configuration: " + configFile );
277277 }
278278 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 );
282282 }
283283 return config ;
284284 } catch (IOException e ) {
@@ -288,6 +288,19 @@ public synchronized RepositoryConfig getRepositoryConfig(String id) {
288288 return null ;
289289 }
290290
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+
291304 @ Override
292305 public RepositoryInfo getRepositoryInfo (String id ) {
293306 RepositoryConfig config = getRepositoryConfig (id );
You can’t perform that action at this time.
0 commit comments