# What is the Workspace API replacement to ModuleExtension such as JavaModuleExternalPaths

**URL:** <https://platform.jetbrains.com/t/what-is-the-workspace-api-replacement-to-moduleextension-such-as-javamoduleexternalpaths/3472>\
**Category:** IntelliJ Platform\
**Tags:** workspace\
**Created:** [January 9, 2026, 7:17pm UTC](https://platform.jetbrains.com/t/what-is-the-workspace-api-replacement-to-moduleextension-such-as-javamoduleexternalpaths/3472 "2026-01-09T19:17:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlytvyn](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/mlytvyn/32/1555_2.png) [@mlytvyn](https://platform.jetbrains.com/u/mlytvyn)\
**Post date:** [January 9, 2026, 7:17pm UTC](https://platform.jetbrains.com/t/what-is-the-workspace-api-replacement-to-moduleextension-such-as-javamoduleexternalpaths/3472/1 "2026-01-09T19:17:44Z")

</div>

Hello!

As one of the tasks related to migration from the Project API to new Workspace API I have to handle somehow ModuleExtensions, is there any Workspace API to do it in a modern way:

```auto
val workspaceModel = WorkspaceModel.getInstance(importContext.project)
val javadocUrl = importContext.javadocUrl
val javaModule = moduleEntity.findModule(workspaceModel.currentSnapshot) ?: return
val modifiableModelsProvider = IdeModifiableModelsProviderImpl(importContext.project)
val modifiableRootModel = modifiableModelsProvider.getModifiableRootModel(javaModule)
val javaModuleExternalPaths = modifiableRootModel.getModuleExtension(JavaModuleExternalPaths::class.java)

javaModuleExternalPaths.javadocUrls = listOf(javadocUrl).toTypedArray()

backgroundWriteAction { modifiableModelsProvider.commit() }

```

this is both ineffective and ugly
