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, setPlatformChecker
public java.lang.String getenv(java.lang.String variable)
SystemReader
getenv
in class SystemReader
variable
- system variable to readpublic java.lang.String getProperty(java.lang.String key)
SystemReader
getProperty
in class SystemReader
key
- of the system property to readpublic FileBasedConfig openSystemConfig(Config parent, FS fs)
SystemReader
SystemReader.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 SystemReader
parent
- 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)
SystemReader
SystemReader.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 SystemReader
parent
- 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)
SystemReader
SystemReader.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 SystemReader
parent
- 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()
SystemReader
getHostname
in class SystemReader
public long getCurrentTime()
SystemReader
getCurrentTime
in class SystemReader
public int getTimezone(long when)
SystemReader
getTimezone
in class SystemReader
when
- a system timestamp