public class MockSystemReader extends SystemReader
Constructor and Description |
---|
MockSystemReader() |
Modifier and Type | Method and Description |
---|---|
void |
clearProperties() |
long |
getCurrentTime() |
DateFormat |
getDateTimeInstance(int dateStyle,
int timeStyle)
Returns a date/time format instance for the given styles.
|
String |
getenv(String variable) |
String |
getHostname()
Gets the hostname of the local host.
|
Locale |
getLocale() |
String |
getProperty(String key) |
SimpleDateFormat |
getSimpleDateFormat(String pattern)
Returns a simple date format instance as specified by the given pattern.
|
TimeZone |
getTimeZone() |
int |
getTimezone(long when) |
FileBasedConfig |
openSystemConfig(Config parent,
FS fs) |
FileBasedConfig |
openUserConfig(Config parent,
FS fs) |
void |
setCurrentPlatform()
Assign some properties for the currently executing platform
|
void |
setProperty(String key,
String value) |
void |
setUnix()
Emulate Unix
|
void |
setWindows()
Emulate Windows
|
checkPath, getInstance, getSimpleDateFormat, isMacOS, isWindows, setInstance, setPlatformChecker
public void clearProperties()
public String getenv(String variable)
getenv
in class SystemReader
variable
- system variable to readpublic String getProperty(String key)
getProperty
in class SystemReader
key
- of the system property to readpublic FileBasedConfig openUserConfig(Config parent, FS fs)
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.public FileBasedConfig openSystemConfig(Config parent, FS fs)
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 String getHostname()
SystemReader
getHostname
in class SystemReader
public long getCurrentTime()
getCurrentTime
in class SystemReader
public int getTimezone(long when)
getTimezone
in class SystemReader
when
- TODOpublic TimeZone getTimeZone()
getTimeZone
in class SystemReader
public Locale getLocale()
getLocale
in class SystemReader
public SimpleDateFormat getSimpleDateFormat(String pattern)
SystemReader
getSimpleDateFormat
in class SystemReader
pattern
- the pattern as defined in
SimpleDateFormat.SimpleDateFormat(String)
public DateFormat getDateTimeInstance(int dateStyle, int timeStyle)
SystemReader
getDateTimeInstance
in class SystemReader
dateStyle
- the date style as specified in
DateFormat.getDateTimeInstance(int, int)
timeStyle
- the time style as specified in
DateFormat.getDateTimeInstance(int, int)
public void setCurrentPlatform()
public void setWindows()
public void setUnix()
Copyright © 2015 Eclipse JGit Project. All rights reserved.