org.eclipse.jgit.util.SystemReader for tests.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private FileBasedConfig | |
| pack-priv long | |
| pack-priv FileBasedConfig | |
| private FileBasedConfig | |
| pack-priv final Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public MonotonicClock | getClock()
Overrides org. Get clock instance preferred by this system. |
| public long | getCurrentTime()
Implements abstract org. Get the current system time |
| public DateFormat | getDateTimeInstance(int
the date style as specified in
dateStyle, int java.the time style as specified in
timeStyle)java.Overrides org. Returns a date/time format instance for the given styles. |
| public String | getenv(String
system variable to read variable)Implements abstract org. Get value of the system variable |
| public String | getHostname()
Implements abstract org. Gets the hostname of the local host. |
| public FileBasedConfig | getJGitConfig()
Overrides org. Get the jgit configuration located at $XDG_CONFIG_HOME/jgit/config. |
| public Locale | |
| public String | getProperty(String
of the system property to read key)Implements abstract org. Get value of the system property |
| public SimpleDateFormat | getSimpleDateFormat(String
the pattern as defined in
pattern)java.Overrides org. Returns a simple date format instance as specified by the given pattern. |
| public StoredConfig | getSystemConfig()
Overrides org. Get the gitconfig configuration found in the system-wide "etc" directory. |
| public int | getTimezone(long
a system timestamp when)Implements abstract org. Get the local time zone |
| public TimeZone | getTimeZone()
Overrides org. Get system time zone, possibly mocked for testing |
| public ZoneId | getTimeZoneId()
Overrides org. Get system time zone, possibly mocked for testing |
| public StoredConfig | getUserConfig()
Overrides org. Get the git configuration found in the user home. |
| private void | |
| public FileBasedConfig | openJGitConfig(Config
a 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)Implements abstract org. Open the jgit configuration located at $XDG_CONFIG_HOME/jgit/config. |
| public FileBasedConfig | openSystemConfig(Config
a 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)Implements abstract org. Open the gitconfig configuration found in the system-wide "etc" directory. |
| public FileBasedConfig | openUserConfig(Config
a 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)Implements abstract org. Open the git configuration found in the user home. |
| private void | |
| public void | |
| public void | setJGitConfig(FileBasedConfig
set the jgit configuration jgitConfig)Set the jgit config stored at $XDG_CONFIG_HOME/jgit/config |
| public void | |
| public FileBasedConfig | Returns: the old system-level configthe new system-level git config systemGitConfig)Set the system-level git config |
| public void | |
| public FileBasedConfig | Returns: the old user-level git configset another user-level git config userGitConfig)Set the user-level git config |
| public void | |
| public void | |
| public String |
| jgitConfig | back to summary |
|---|---|
| private FileBasedConfig jgitConfig | |
| now | back to summary |
|---|---|
| pack-priv long now | |
| systemGitConfig | back to summary |
|---|---|
| pack-priv FileBasedConfig systemGitConfig | |
| userGitConfig | back to summary |
|---|---|
| private FileBasedConfig userGitConfig | |
| values | back to summary |
|---|---|
| pack-priv final Map<String, String> values | |
| MockSystemReader | back to summary |
|---|---|
| public MockSystemReader() Constructor for | |
| clearProperties | back to summary |
|---|---|
| public void clearProperties() Clear properties | |
| getClock | back to summary |
|---|---|
| public MonotonicClock getClock() Overrides org. Doc from org. Get clock instance preferred by this system.
| |
| getCurrentTime | back to summary |
|---|---|
| public long getCurrentTime() Implements abstract org. Doc from org. Get the current system time
| |
| getDateTimeInstance | back to summary |
|---|---|
| public DateFormat getDateTimeInstance(int dateStyle, int timeStyle) Overrides org. Doc from org. Returns a date/time format instance for the given styles.
| |
| getenv | back to summary |
|---|---|
| public String getenv(String variable) Implements abstract org. Doc from org. Get value of the system variable | |
| getHostname | back to summary |
|---|---|
| public String getHostname() Implements abstract org. Doc from org. Gets the hostname of the local host. If no hostname can be found, the hostname is set to the default value "localhost". | |
| getJGitConfig | back to summary |
|---|---|
| public FileBasedConfig getJGitConfig() Overrides org. Doc from org. Get the jgit configuration located at $XDG_CONFIG_HOME/jgit/config. The configuration will be reloaded automatically if the configuration file was modified. If the configuration file wasn't modified returns the cached configuration.
| |
| getLocale | back to summary |
|---|---|
| public Locale getLocale() Overrides org. Doc from org. Get the locale to use | |
| getProperty | back to summary |
|---|---|
| public String getProperty(String key) Implements abstract org. Doc from org. Get value of the system property | |
| getSimpleDateFormat | back to summary |
|---|---|
| public SimpleDateFormat getSimpleDateFormat(String pattern) Overrides org. Doc from org. Returns a simple date format instance as specified by the given pattern.
| |
| getSystemConfig | back to summary |
|---|---|
| public StoredConfig getSystemConfig() throws IOException, ConfigInvalidException Overrides org. Doc from org. Get the gitconfig configuration found in the system-wide "etc" directory. The configuration will be reloaded automatically if the configuration file was modified otherwise returns the cached system level config.
| |
| getTimezone | back to summary |
|---|---|
| public int getTimezone(long when) Implements abstract org. Doc from org. Get the local time zone
| |
| getTimeZone | back to summary |
|---|---|
| public TimeZone getTimeZone() Overrides org. Doc from org. Get system time zone, possibly mocked for testing | |
| getTimeZoneId | back to summary |
|---|---|
| public ZoneId getTimeZoneId() Overrides org. Doc from org. Get system time zone, possibly mocked for testing | |
| getUserConfig | back to summary |
|---|---|
| public StoredConfig getUserConfig() throws IOException, ConfigInvalidException Overrides org. Doc from org. Get the git configuration found in the user home. The configuration will be reloaded automatically if the configuration file was modified. Also reloads the system config if the system config file was modified. If the configuration file wasn't modified returns the cached configuration.
| |
| init | back to summary |
|---|---|
| private void init(String n) | |
| openJGitConfig | back to summary |
|---|---|
| public FileBasedConfig openJGitConfig(Config parent, FS fs) Implements abstract org. Doc from org. Open the jgit configuration located at $XDG_CONFIG_HOME/jgit/config. Use
| |
| openSystemConfig | back to summary |
|---|---|
| public FileBasedConfig openSystemConfig(Config parent, FS fs) Implements abstract org. Doc from org. Open the gitconfig configuration found in the system-wide "etc"
directory. Use
| |
| openUserConfig | back to summary |
|---|---|
| public FileBasedConfig openUserConfig(Config parent, FS fs) Implements abstract org. Doc from org. Open the git configuration found in the user home. Use
| |
| resetOsNames | back to summary |
|---|---|
| private void resetOsNames() | |
| setCurrentPlatform | back to summary |
|---|---|
| public void setCurrentPlatform() Assign some properties for the currently executing platform | |
| setJGitConfig | back to summary |
|---|---|
| public void setJGitConfig(FileBasedConfig jgitConfig) Set the jgit config stored at $XDG_CONFIG_HOME/jgit/config
| |
| setProperty | back to summary |
|---|---|
| public void setProperty(String key, String value) Set a property | |
| setSystemGitConfig | back to summary |
|---|---|
| public FileBasedConfig setSystemGitConfig(FileBasedConfig systemGitConfig) Set the system-level git config
| |
| setUnix | back to summary |
|---|---|
| public void setUnix() Emulate Unix | |
| setUserGitConfig | back to summary |
|---|---|
| public FileBasedConfig setUserGitConfig(FileBasedConfig userGitConfig) Set the user-level git config
| |
| setWindows | back to summary |
|---|---|
| public void setWindows() Emulate Windows | |
| tick | back to summary |
|---|---|
| public void tick(int secDelta) Adjusts the current time in seconds.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | isOutdated()
Overrides org. Whether the currently loaded configuration file is outdated |
| public void | load()
Overrides org. Load the configuration from the persistent store. |
| public void | save()
Overrides org. Save the configuration to the persistent store. |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| MockConfig | back to summary |
|---|---|
| private MockConfig(File cfgLocation, FS fs) | |
| isOutdated | back to summary |
|---|---|
| public boolean isOutdated() Overrides org. Doc from org. Whether the currently loaded configuration file is outdated
| |
| load | back to summary |
|---|---|
| public void load() throws IOException, ConfigInvalidException Overrides org. Doc from org. Load the configuration from the persistent store. If the configuration does not exist, this configuration is cleared, and thus behaves the same as though the backing store exists, but is empty. Load the configuration as a Git text style configuration file. If the file does not exist, this configuration is cleared, and thus behaves the same as though the file exists, but is empty.
| |
| save | back to summary |
|---|---|
| public void save() throws IOException Overrides org. Doc from org. Save the configuration to the persistent store. Save the configuration as a Git text style configuration file. Warning Although this method uses the traditional Git file locking approach to protect against concurrent writes of the configuration file, it does not ensure that the file has not been modified since the last read, which means updates performed by other objects accessing the same backing file may be lost.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |