Package adams.core.git
Class GitSettingsHelper
- java.lang.Object
-
- adams.core.git.GitSettingsHelper
-
public class GitSettingsHelper extends Object
Helper class for the default git.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description static String
EMAIL
the email.static String
FILENAME
the props file.static String
FLOW_EDITOR_SUPPORT
the flow editor support.static String
KNOWN_HOSTS
the known_hosts file.static String
LOGGING_LEVEL
the logging level.protected boolean
m_Modified
whether the settings got modified.protected adams.core.Properties
m_Properties
the properties.protected static GitSettingsHelper
m_Singleton
the singleton.static String
SSH_DIR
the ssh key dir.static String
USER
the user.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDefaultKnownHosts()
Returns the default known_hosts file.String
getDefaultSshDir()
Returns the default ssh dir.String
getEmail()
Returns the email for commits.boolean
getFlowEditorSupport()
Returns whether to enable git support in the flow editor.String
getGlobalEmail()
Returns the global email, if possible.String
getGlobalUser()
Returns the global user, if possible.String
getKnownHosts()
Returns the known_hosts file.adams.core.io.PlaceholderFile
getKnownHostsFile()
Returns the known_hosts file.adams.core.logging.LoggingLevel
getLoggingLevel()
Returns the email for commits.adams.core.Properties
getProperties()
Returns the current properties.static GitSettingsHelper
getSingleton()
Returns the singleton.String
getSshDir()
Returns the ssh key dir.adams.core.io.PlaceholderFile
getSshDirFile()
Returns the ssh dir file.String
getUser()
Returns the user for commits.boolean
isModified()
Whether the settings got modified.void
reload()
Reloads the properties file.boolean
save()
Saves the settings in the user's home directory.void
setEmail(String value)
Updates the email for commits.void
setFlowEditorSupport(boolean value)
Updates whether to enable git support in the flow editor.void
setKnownHosts(String value)
Updates the known_hosts file.void
setSshDir(String value)
Updates the ssh key file.void
setUser(String value)
Updates the user for commits.
-
-
-
Field Detail
-
FILENAME
public static final String FILENAME
the props file.- See Also:
- Constant Field Values
-
SSH_DIR
public static final String SSH_DIR
the ssh key dir.- See Also:
- Constant Field Values
-
KNOWN_HOSTS
public static final String KNOWN_HOSTS
the known_hosts file.- See Also:
- Constant Field Values
-
USER
public static final String USER
the user.- See Also:
- Constant Field Values
-
EMAIL
public static final String EMAIL
the email.- See Also:
- Constant Field Values
-
LOGGING_LEVEL
public static final String LOGGING_LEVEL
the logging level.- See Also:
- Constant Field Values
-
FLOW_EDITOR_SUPPORT
public static final String FLOW_EDITOR_SUPPORT
the flow editor support.- See Also:
- Constant Field Values
-
m_Singleton
protected static GitSettingsHelper m_Singleton
the singleton.
-
m_Properties
protected adams.core.Properties m_Properties
the properties.
-
m_Modified
protected boolean m_Modified
whether the settings got modified.
-
-
Method Detail
-
isModified
public boolean isModified()
Whether the settings got modified.- Returns:
- true if modified
-
getDefaultSshDir
public String getDefaultSshDir()
Returns the default ssh dir.- Returns:
- the default dir
-
getSshDir
public String getSshDir()
Returns the ssh key dir.- Returns:
- the dir, by default the user's home dir + .ssh
-
getSshDirFile
public adams.core.io.PlaceholderFile getSshDirFile()
Returns the ssh dir file.- Returns:
- the directory
-
setSshDir
public void setSshDir(String value)
Updates the ssh key file.- Parameters:
value
- the file
-
getDefaultKnownHosts
public String getDefaultKnownHosts()
Returns the default known_hosts file.- Returns:
- the default file
-
getKnownHosts
public String getKnownHosts()
Returns the known_hosts file.- Returns:
- the file, by default the user's home dir + .ssh/known_hosts
-
getKnownHostsFile
public adams.core.io.PlaceholderFile getKnownHostsFile()
Returns the known_hosts file.- Returns:
- the file
-
setKnownHosts
public void setKnownHosts(String value)
Updates the known_hosts file.- Parameters:
value
- the file
-
getGlobalUser
public String getGlobalUser()
Returns the global user, if possible.- Returns:
- the global user, empty string if not available
-
getUser
public String getUser()
Returns the user for commits.- Returns:
- the user
-
setUser
public void setUser(String value)
Updates the user for commits.- Parameters:
value
- the user
-
getGlobalEmail
public String getGlobalEmail()
Returns the global email, if possible.- Returns:
- the global email, empty string if not available
-
getEmail
public String getEmail()
Returns the email for commits.- Returns:
- the email
-
setEmail
public void setEmail(String value)
Updates the email for commits.- Parameters:
value
- the email
-
getLoggingLevel
public adams.core.logging.LoggingLevel getLoggingLevel()
Returns the email for commits.- Returns:
- the email
-
reload
public void reload()
Reloads the properties file. Discards any unsaved settings.
-
getFlowEditorSupport
public boolean getFlowEditorSupport()
Returns whether to enable git support in the flow editor.- Returns:
- true if to enable support
-
setFlowEditorSupport
public void setFlowEditorSupport(boolean value)
Updates whether to enable git support in the flow editor.- Parameters:
value
- true if to enable support
-
getProperties
public adams.core.Properties getProperties()
Returns the current properties.- Returns:
- the properties
-
save
public boolean save()
Saves the settings in the user's home directory.- Returns:
- true if successfully saved
-
getSingleton
public static GitSettingsHelper getSingleton()
Returns the singleton.- Returns:
- the singleton
-
-