Package org.eclipse.jgit.util
Class SystemReader.Default
java.lang.Object
org.eclipse.jgit.util.SystemReader
org.eclipse.jgit.util.SystemReader.Default
- Enclosing class:
- SystemReader
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
Get the current system timeGet value of the system variableGets the hostname of the local host.getProperty
(String key) Get value of the system propertyint
getTimezone
(long when) Get the local time zoneprivate Path
getXDGConfigHome
(FS fs) openJGitConfig
(Config parent, FS fs) Open the jgit configuration located at $XDG_CONFIG_HOME/jgit/config.openSystemConfig
(Config parent, FS fs) Open the gitconfig configuration found in the system-wide "etc" directory.openUserConfig
(Config parent, FS fs) Open the git configuration found in the user home.Methods inherited from class org.eclipse.jgit.util.SystemReader
checkPath, checkPath, getClock, getDateTimeInstance, getDefaultCharset, getInstance, getJGitConfig, getLocale, getSimpleDateFormat, getSimpleDateFormat, getSystemConfig, getTimeZone, getUserConfig, isMacOS, isWindows, setInstance, setPlatformChecker
-
Field Details
-
hostname
-
-
Constructor Details
-
Default
private Default()
-
-
Method Details
-
getenv
Description copied from class:SystemReader
Get value of the system variable- Specified by:
getenv
in classSystemReader
- Parameters:
variable
- system variable to read- Returns:
- value of the system variable
-
getProperty
Description copied from class:SystemReader
Get value of the system property- Specified by:
getProperty
in classSystemReader
- Parameters:
key
- of the system property to read- Returns:
- value of the system property
-
openSystemConfig
Description copied from class:SystemReader
Open the gitconfig configuration found in the system-wide "etc" directory. UseSystemReader.getSystemConfig()
to get the current system-wide git configuration since it manages automatic reloading when the gitconfig file was modified and avoids unnecessary reloads.- Specified by:
openSystemConfig
in classSystemReader
- Parameters:
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.- Returns:
- the gitconfig configuration found in the system-wide "etc" directory
-
openUserConfig
Description copied from class:SystemReader
Open the git configuration found in the user home. UseSystemReader.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.- Specified by:
openUserConfig
in classSystemReader
- Parameters:
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.- Returns:
- the git configuration found in the user home
-
getXDGConfigHome
-
openJGitConfig
Description copied from class:SystemReader
Open the jgit configuration located at $XDG_CONFIG_HOME/jgit/config. UseSystemReader.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.- Specified by:
openJGitConfig
in classSystemReader
- Parameters:
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.- Returns:
- the jgit configuration located at $XDG_CONFIG_HOME/jgit/config
-
getHostname
Description copied from class:SystemReader
Gets the hostname of the local host. If no hostname can be found, the hostname is set to the default value "localhost".- Specified by:
getHostname
in classSystemReader
- Returns:
- the canonical hostname
-
getCurrentTime
public long getCurrentTime()Description copied from class:SystemReader
Get the current system time- Specified by:
getCurrentTime
in classSystemReader
- Returns:
- the current system time
-
getTimezone
public int getTimezone(long when) Description copied from class:SystemReader
Get the local time zone- Specified by:
getTimezone
in classSystemReader
- Parameters:
when
- a system timestamp- Returns:
- the local time zone
-