Class OpenStegoException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.openstego.desktop.OpenStegoException
All Implemented Interfaces:
Serializable

public class OpenStegoException extends Exception
Custom exception class for OpenStego
See Also:
  • Field Details

    • INVALID_PASSWORD

      public static final int INVALID_PASSWORD
      Error Code - Invalid password
      See Also:
    • INVALID_USE_COMPR_VALUE

      public static final int INVALID_USE_COMPR_VALUE
      Error Code - Invalid value for useCompression
      See Also:
    • INVALID_USE_ENCRYPT_VALUE

      public static final int INVALID_USE_ENCRYPT_VALUE
      Error Code - Invalid value for useEncryption
      See Also:
    • INVALID_KEY_NAME

      public static final int INVALID_KEY_NAME
      Error Code - Invalid key name
      See Also:
    • CORRUPT_DATA

      public static final int CORRUPT_DATA
      Error Code - Corrupt Data
      See Also:
    • NO_VALID_PLUGIN

      public static final int NO_VALID_PLUGIN
      Error Code - No valid plugin
      See Also:
    • IMAGE_TYPE_INVALID

      public static final int IMAGE_TYPE_INVALID
      Error Code - Image type invalid
      See Also:
    • IMAGE_FILE_INVALID

      public static final int IMAGE_FILE_INVALID
      Error Code - Image file invalid
      See Also:
    • NO_PLUGIN_SPECIFIED

      public static final int NO_PLUGIN_SPECIFIED
      Error Code - No plugin specified
      See Also:
    • PLUGIN_DOES_NOT_SUPPORT_WM

      public static final int PLUGIN_DOES_NOT_SUPPORT_WM
      Error Code - Plugin does not support watermarking
      See Also:
    • PLUGIN_NOT_FOUND

      public static final int PLUGIN_NOT_FOUND
      Error Code - Plugin not found
      See Also:
    • IMAGE_SIZE_MISMATCH

      public static final int IMAGE_SIZE_MISMATCH
      Error Code - Image sizes mismatch
      See Also:
    • OUT_OF_MEMORY

      public static final int OUT_OF_MEMORY
      Error Code - Out of memory
      See Also:
    • PLUGIN_DOES_NOT_SUPPORT_DH

      public static final int PLUGIN_DOES_NOT_SUPPORT_DH
      Error Code - Plugin does not support data hiding
      See Also:
    • PWD_MANDATORY_FOR_GENSIG

      public static final int PWD_MANDATORY_FOR_GENSIG
      Error Code - Password is mandatory for 'gensig' operation
      See Also:
    • INVALID_CRYPT_ALGO

      public static final int INVALID_CRYPT_ALGO
      Error Code - Invalid key name
      See Also:
    • USERPREF_INVALID_INT

      public static final int USERPREF_INVALID_INT
      Error Code - Invalid integer in user preference file
      See Also:
    • USERPREF_INVALID_FLOAT

      public static final int USERPREF_INVALID_FLOAT
      Error Code - Invalid float in user preference file
      See Also:
    • USERPREF_INVALID_BOOL

      public static final int USERPREF_INVALID_BOOL
      Error Code - Invalid boolean in user preference file
      See Also:
  • Constructor Details

    • OpenStegoException

      public OpenStegoException(Throwable cause)
      Constructor using default namespace for unhandled exceptions
      Parameters:
      cause - Original exception which caused this exception to be raised
    • OpenStegoException

      public OpenStegoException(Throwable cause, String namespace, int errorCode)
      Default constructor
      Parameters:
      cause - Original exception which caused this exception to be raised
      namespace - Namespace of the error
      errorCode - Error code for the exception
    • OpenStegoException

      public OpenStegoException(Throwable cause, String namespace, int errorCode, String param)
      Constructor with a single parameter for the message
      Parameters:
      cause - Original exception which caused this exception to be raised
      namespace - Namespace of the error
      errorCode - Error code for the exception
      param - Parameter for exception message
    • OpenStegoException

      public OpenStegoException(Throwable cause, String namespace, int errorCode, Object... params)
      Constructor which takes object array for parameters for the message
      Parameters:
      cause - Original exception which caused this exception to be raised
      namespace - Namespace of the error
      errorCode - Error code for the exception
      params - Parameters for exception message
  • Method Details

    • getErrorCode

      public int getErrorCode()
      Get method for errorCode
      Returns:
      errorCode
    • getNamespace

      public String getNamespace()
      Get method for namespace
      Returns:
      namespace
    • addErrorCode

      public static void addErrorCode(String namespace, int errorCode, String labelKey)
      Method to add new error codes to the namespace
      Parameters:
      namespace - Namespace for the error
      errorCode - Error code of the error
      labelKey - Key of the label for the error