void (final String url, final String location, Disposable disposable) { Application app = ApplicationManager.getApplication(); app.runWriteAction(() -> getInstance().addResource(url, location)); Disposer.register(disposable, () -> app.runWriteAction(() -> getInstance().removeResource(url))); }