When writing unit tests, extending this interface with a custom class permits to simulate an access to a system variable or property and permits to control the user's global configuration.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| public static class | SystemReader.
Delegating SystemReader. |
| Modifier and Type | Field and Description |
|---|---|
| private static final SystemReader | |
| private volatile Charset | |
| private static final String | |
| private static volatile SystemReader | |
| private static volatile Boolean | |
| private static volatile Boolean | |
| private static volatile Boolean | |
| private AtomicReference | |
| private static final Logger | |
| private static final boolean | |
| private ObjectChecker | |
| private AtomicReference | |
| private AtomicReference |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public LocalDateTime | |
| public MonotonicClock | Returns: clock instance preferred by this system.Get clock instance preferred by this system. |
| public abstract long | Returns: the current system time
Deprecated
since 7.1. Use
now()
Get the current system time |
| public DateFormat | Returns: the date formatthe date style as specified in
dateStyle, int java.the time style as specified in
timeStyle)java.Returns a date/time format instance for the given styles. |
| public Charset | Returns: theCharsetRetrieves the default |
| public abstract String | |
| public abstract String | |
| public static SystemReader | |
| public StoredConfig | Returns: the jgit configuration located at $XDG_CONFIG_HOME/jgit/configGet the jgit configuration located at $XDG_CONFIG_HOME/jgit/config. |
| public Locale | |
| private String | |
| public abstract String | Returns: value of the system propertyof the system property to read key)Get value of the system property |
| public SimpleDateFormat | Returns: the simple date formatthe pattern as defined in
pattern)java.Returns a simple date format instance as specified by the given pattern. |
| public SimpleDateFormat | Returns: the simple date formatthe pattern as defined in
pattern, Locale java.locale to be used for the locale)SimpleDateFormatReturns a simple date format instance as specified by the given pattern. |
| public StoredConfig | Returns: the gitconfig configuration found in the system-wide "etc" directoryGet the gitconfig configuration found in the system-wide "etc" directory. |
| public abstract int | Returns: the local time zonea system timestamp when)
Deprecated
since 7.1. Use
getTimeZoneAt(Instant) instead.
Get the local time zone |
| public TimeZone | Returns: system time zone, possibly mocked for testing
Deprecated
since 7.1. Use
getTimeZoneId()
Get system time zone, possibly mocked for testing |
| public ZoneOffset | Returns: the local time zonea system timestamp when)Get the local time zone offset at "when" time |
| public ZoneId | Returns: system time zone, possibly mocked for testingGet system time zone, possibly mocked for testing |
| public StoredConfig | Returns: the git configuration found in the user homeGet the git configuration found in the user home. |
| public Path | Returns: aPath denoting the directory, which may exist or not, or
null if the environment variable is not set and there is
no home directory, or the path is invalid.FS to get the user's home directoryGets the directory denoted by environment variable XDG_CONFIG_HOME. |
| private void | |
| private static boolean | |
| public boolean | |
| public boolean | |
| public boolean | Returns: whether performance trace is enabledWhether performance trace is enabled |
| public boolean | |
| public Instant | |
| public abstract FileBasedConfig | Returns: the jgit configuration located at $XDG_CONFIG_HOME/jgit/configa config with values not found directly in the returned config parent, FS the file system abstraction which will be necessary to perform
certain file system operations. fs)Open the jgit configuration located at $XDG_CONFIG_HOME/jgit/config. |
| public abstract FileBasedConfig | Returns: the gitconfig configuration found in the system-wide "etc" directorya config with values not found directly in the returned
config. Null is a reasonable value here. parent, FS the file system abstraction which will be necessary to perform
certain file system operations. fs)Open the gitconfig configuration found in the system-wide "etc" directory. |
| public abstract FileBasedConfig | Returns: the git configuration found in the user homea config with values not found directly in the returned config parent, FS the file system abstraction which will be necessary to perform
certain file system operations. fs)Open the git configuration found in the user home. |
| public static void | setInstance(SystemReader
the new instance to use when accessing properties, or null for
the default instance. newReader)Set a new SystemReader instance to use when accessing properties. |
| protected final void | |
| private void |