Class RegistryException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.github.robtimus.os.windows.registry.RegistryException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
InvalidRegistryHandleException
,NoSuchRegistryKeyException
,NoSuchRegistryValueException
,RegistryAccessDeniedException
,RegistryKeyAlreadyExistsException
public class RegistryException extends RuntimeException
Thrown when an error occurred while trying to access or modify the Windows registry.- Author:
- Rob Spoor
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RegistryException(int errorCode, String path)
Creates a new exception.RegistryException(int errorCode, String path, String machineName)
Creates a new exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
errorCode()
Returns the error code that was returned from the Windows API.String
machineName()
Returns the remote machine of the registry key for which this exception was thrown.String
path()
Returns the path of the registry key for which this exception was thrown.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
RegistryException
public RegistryException(int errorCode, String path)
Creates a new exception.- Parameters:
errorCode
- The error code that was returned from the Windows API.path
- The path of the registry key for which this exception was thrown.
-
RegistryException
public RegistryException(int errorCode, String path, String machineName)
Creates a new exception.- Parameters:
errorCode
- The error code that was returned from the Windows API.path
- The path of the registry key for which this exception was thrown.machineName
- The remote machine of the registry key for which this exception was thrown, ornull
for the local machine.- Since:
- 1.1
-
-
Method Detail
-
errorCode
public int errorCode()
Returns the error code that was returned from the Windows API.- Returns:
- The error code that was returned from the Windows API.
-
path
public String path()
Returns the path of the registry key for which this exception was thrown.- Returns:
- The path of the registry key for which this exception was thrown.
-
machineName
public String machineName()
Returns the remote machine of the registry key for which this exception was thrown.- Returns:
- The remote machine of the registry key for which this exception was thrown, or
null
for the local machine. - Since:
- 1.1
-
-