private static class SystemReader.Default extends SystemReader
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
hostname |
| Modifier | Constructor and Description |
|---|---|
private |
Default() |
| Modifier and Type | Method and Description |
|---|---|
long |
getCurrentTime()
Get the current system time
|
java.lang.String |
getenv(java.lang.String variable)
Get value of the system variable
|
java.lang.String |
getHostname()
Gets the hostname of the local host.
|
java.lang.String |
getProperty(java.lang.String key)
Get value of the system property
|
int |
getTimezone(long when)
Get the local time zone
|
private java.nio.file.Path |
getXDGConfigHome(FS fs) |
FileBasedConfig |
openJGitConfig(Config parent,
FS fs)
Open the jgit configuration located at $XDG_CONFIG_HOME/jgit/config.
|
FileBasedConfig |
openSystemConfig(Config parent,
FS fs)
Open the gitconfig configuration found in the system-wide "etc"
directory.
|
FileBasedConfig |
openUserConfig(Config parent,
FS fs)
Open the git configuration found in the user home.
|
checkPath, checkPath, getClock, getDateTimeInstance, getInstance, getJGitConfig, getLocale, getSimpleDateFormat, getSimpleDateFormat, getSystemConfig, getTimeZone, getUserConfig, isMacOS, isWindows, setInstance, setPlatformCheckerpublic java.lang.String getenv(java.lang.String variable)
SystemReadergetenv in class SystemReadervariable - system variable to readpublic java.lang.String getProperty(java.lang.String key)
SystemReadergetProperty in class SystemReaderkey - of the system property to readpublic FileBasedConfig openSystemConfig(Config parent, FS fs)
SystemReaderSystemReader.getSystemConfig() to get the current system-wide
git configuration since it manages automatic reloading when the gitconfig
file was modified and avoids unnecessary reloads.openSystemConfig in class SystemReaderparent - a config with values not found directly in the returned
config. Null is a reasonable value here.fs - the file system abstraction which will be necessary to perform
certain file system operations.public FileBasedConfig openUserConfig(Config parent, FS fs)
SystemReaderSystemReader.getUserConfig() to get the current git configuration in the user
home since it manages automatic reloading when the gitconfig file was
modified and avoids unnecessary reloads.openUserConfig in class SystemReaderparent - a config with values not found directly in the returned configfs - the file system abstraction which will be necessary to perform
certain file system operations.private java.nio.file.Path getXDGConfigHome(FS fs)
public FileBasedConfig openJGitConfig(Config parent, FS fs)
SystemReaderSystemReader.getJGitConfig() to get the current jgit configuration in the
user home since it manages automatic reloading when the jgit config file
was modified and avoids unnecessary reloads.openJGitConfig in class SystemReaderparent - a config with values not found directly in the returned configfs - the file system abstraction which will be necessary to perform
certain file system operations.public java.lang.String getHostname()
SystemReadergetHostname in class SystemReaderpublic long getCurrentTime()
SystemReadergetCurrentTime in class SystemReaderpublic int getTimezone(long when)
SystemReadergetTimezone in class SystemReaderwhen - a system timestamp