final ServerEnvironment serverenv = injectedServerEnvironment.getValue();
final File storageDir = new File(serverenv.getServerDataDir().getPath() + File.separator + "repository");
RepositoryStorageFactory factory = new RepositoryStorageFactory() {
@Override
public RepositoryStorage create(XRepository repository) {
return new FileBasedRepositoryStorage(repository, storageDir) {
@Override
public XResource addResource(XResource res) throws RepositoryStorageException {
// Do not add modules to repository storage
if (res.getCapabilities(MODULE_IDENTITY_NAMESPACE).isEmpty()) {
return super.addResource(res);