mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 22:15:45 +01:00
fix wrong initializing order
This commit is contained in:
@@ -91,7 +91,7 @@ public class JAXBStoreFactory implements ListenableStoreFactory
|
||||
public void init(SCMContextProvider context)
|
||||
{
|
||||
configDirectory = new File(context.getBaseDirectory(),
|
||||
CONFIGDIRECTORY_NAME);
|
||||
CONFIGDIRECTORY_NAME);
|
||||
IOUtil.mkdirs(configDirectory);
|
||||
}
|
||||
|
||||
@@ -110,12 +110,17 @@ public class JAXBStoreFactory implements ListenableStoreFactory
|
||||
@Override
|
||||
public <T> JAXBStore<T> getStore(Class<T> type, String name)
|
||||
{
|
||||
if (configDirectory == null)
|
||||
{
|
||||
throw new IllegalStateException("store factory is not initialized");
|
||||
}
|
||||
|
||||
File configFile = new File(configDirectory, name.concat(FILE_EXTENSION));
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("create store for {} at {}", type.getName(),
|
||||
configFile.getPath());
|
||||
configFile.getPath());
|
||||
}
|
||||
|
||||
return new JAXBStore<T>(type, configFile);
|
||||
|
||||
Reference in New Issue
Block a user