Class Win32_TimeZone
The following attributes are fetched: Caption, Bias, StandardName
- Author:
- Egg-03
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the OS Time-zone
-
Method Details
-
getOSTimeZone
public static Map<String,String> getOSTimeZone() throws IOException, IndexOutOfBoundsException, ShellException, InterruptedExceptionRetrieves the OS Time-zone- Returns:
- a
Map
of Time-zone properties and values mentioned in the class description - Throws:
IOException
- re-throws the exception thrown byCIM_ML.getPropertiesAndTheirValues(String, String)
when there are I/O Errors during streaming of data from and to Powershell and other generated filesIndexOutOfBoundsException
- re-throws the exception thrown byCIM_ML.getPropertiesAndTheirValues(String, String)
when there is a parsing error of data fetched from Windows PowershellShellException
- if any internal command used in the powershell throws errorsInterruptedException
- if the thread waiting for the process to exit, gets interrupted. When catching this exception, you may re-throw it's interrupted status by using Thread.currentThread().interrupt();While catching any of the Exceptions, you may return an empty Map to avoid any
NullPointerException
that might get thrown because your variable might be expecting a string. However, this does not make you immune from the NullPointerExceptions that may be thrown in case of powershell output format changes in the future, causing the underlying parsing logic to fail.
-