Fix directory for file based stores

This commit is contained in:
René Pfeuffer
2018-12-12 15:59:53 +01:00
parent b4081aaa99
commit ddc2cbbfab

View File

@@ -58,8 +58,6 @@ public abstract class FileBasedStoreFactory {
private RepositoryLocationResolver repositoryLocationResolver; private RepositoryLocationResolver repositoryLocationResolver;
private Store store; private Store store;
private File storeDirectory;
protected FileBasedStoreFactory(SCMContextProvider contextProvider , RepositoryLocationResolver repositoryLocationResolver, Store store) { protected FileBasedStoreFactory(SCMContextProvider contextProvider , RepositoryLocationResolver repositoryLocationResolver, Store store) {
this.contextProvider = contextProvider; this.contextProvider = contextProvider;
this.repositoryLocationResolver = repositoryLocationResolver; this.repositoryLocationResolver = repositoryLocationResolver;
@@ -75,7 +73,7 @@ public abstract class FileBasedStoreFactory {
} }
protected File getStoreLocation(String name, Class type, Repository repository) { protected File getStoreLocation(String name, Class type, Repository repository) {
if (storeDirectory == null) { File storeDirectory;
if (repository != null) { if (repository != null) {
LOG.debug("create store with type: {}, name: {} and repository: {}", type, name, repository.getNamespaceAndName()); LOG.debug("create store with type: {}, name: {} and repository: {}", type, name, repository.getNamespaceAndName());
storeDirectory = this.getStoreDirectory(store, repository); storeDirectory = this.getStoreDirectory(store, repository);
@@ -84,8 +82,7 @@ public abstract class FileBasedStoreFactory {
storeDirectory = this.getStoreDirectory(store); storeDirectory = this.getStoreDirectory(store);
} }
IOUtil.mkdirs(storeDirectory); IOUtil.mkdirs(storeDirectory);
} return new File(storeDirectory, name);
return new File(this.storeDirectory, name);
} }
/** /**