java.lang.Object
org.eclipse.jgit.util.SystemReader
org.eclipse.jgit.util.SystemReader.Delegate
- Enclosing class:
- SystemReader
Delegating SystemReader. Reduces boiler-plate code applications need to
implement when overriding only a few of the SystemReader's methods.
- Since:
- 6.9
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jgit.util.SystemReader
SystemReader.Delegate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongGet the current system timeGet value of the system variableGets the hostname of the local host.getProperty(String key) Get value of the system propertyintgetTimezone(long when) Get the local time zonegetTimeZoneAt(Instant when) Get the local time zone offset at "when" timenow()Get the current system timeopenJGitConfig(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, civilNow, getClock, getDateTimeInstance, getDefaultCharset, getInstance, getJGitConfig, getLocale, getSimpleDateFormat, getSimpleDateFormat, getSystemConfig, getTimeZone, getTimeZoneId, getUserConfig, getXdgConfigDirectory, isLinux, isMacOS, isPerformanceTraceEnabled, isWindows, setInstance, setPlatformChecker
-
Constructor Details
-
Delegate
Create a delegating system reader- Parameters:
delegate- the system reader to delegate to
-
-
Method Details
-
getHostname
Description copied from class:SystemReaderGets the hostname of the local host. If no hostname can be found, the hostname is set to the default value "localhost".- Specified by:
getHostnamein classSystemReader- Returns:
- the canonical hostname
-
getenv
Description copied from class:SystemReaderGet value of the system variable- Specified by:
getenvin classSystemReader- Parameters:
variable- system variable to read- Returns:
- value of the system variable
-
getProperty
Description copied from class:SystemReaderGet value of the system property- Specified by:
getPropertyin classSystemReader- Parameters:
key- of the system property to read- Returns:
- value of the system property
-
openUserConfig
Description copied from class:SystemReaderOpen 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:
openUserConfigin 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
-
openSystemConfig
Description copied from class:SystemReaderOpen 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:
openSystemConfigin 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
-
openJGitConfig
Description copied from class:SystemReaderOpen 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:
openJGitConfigin 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
-
getCurrentTime
public long getCurrentTime()Description copied from class:SystemReaderGet the current system time- Specified by:
getCurrentTimein classSystemReader- Returns:
- the current system time
-
now
Description copied from class:SystemReaderGet the current system time- Overrides:
nowin classSystemReader- Returns:
- the current system time
-
getTimezone
public int getTimezone(long when) Description copied from class:SystemReaderGet the local time zone- Specified by:
getTimezonein classSystemReader- Parameters:
when- a system timestamp- Returns:
- the local time zone
-
getTimeZoneAt
Description copied from class:SystemReaderGet the local time zone offset at "when" time- Overrides:
getTimeZoneAtin classSystemReader- Parameters:
when- a system timestamp- Returns:
- the local time zone
-