public class UserConfigurationPersisterImpl extends Object implements UserConfigurationPersister
Constructor and Description |
---|
UserConfigurationPersisterImpl(File configurationDirectory) |
Modifier and Type | Method and Description |
---|---|
void |
detectPersistedConfigurationType()
Detects the persisted configuration type.
|
InputStream |
getConfigurationStream()
Returns the active configuration.
|
UserConfigurationType |
getConfigurationType()
Returns the current configuration type
|
boolean |
isCustomConfigurationAvailable()
Returns true if a custom Atlassian User configuration file is available.
|
void |
updateConfiguration(UserConfigurationType configurationType)
Updates configuration to the given configuration type.
|
public UserConfigurationPersisterImpl(File configurationDirectory) throws IOException
IOException
public InputStream getConfigurationStream() throws IOException
UserConfigurationPersister
getConfigurationStream
in interface UserConfigurationPersister
IOException
- if the file cannot be readpublic void updateConfiguration(@NotNull UserConfigurationType configurationType) throws IOException
UserConfigurationPersister
updateConfiguration
in interface UserConfigurationPersister
configurationType
- new configuration typeIOException
- If the configuration could not be updatedpublic UserConfigurationType getConfigurationType()
UserConfigurationPersister
getConfigurationType
in interface UserConfigurationPersister
public boolean isCustomConfigurationAvailable()
UserConfigurationPersister
isCustomConfigurationAvailable
in interface UserConfigurationPersister
true
if the current configuration is UserConfigurationType.CUSTOM
or if a backup
is availablepublic void detectPersistedConfigurationType() throws IOException
UserConfigurationPersister
Should be called when it is likely that atlassian-user.xml has been modified.
detectPersistedConfigurationType
in interface UserConfigurationPersister
IOException
- if the persistent configuration could not be readCopyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.