com.miginfocom.util
Class LicenseValidator

java.lang.Object
  extended by com.miginfocom.util.LicenseValidator

public final class LicenseValidator
extends java.lang.Object

The class that the user should set it's license key on to use the MiG Calendar Component.

If no license or not a valid one the component will go into demo mode.


Field Summary
static java.lang.String DBC
           
static java.lang.String DBG
           
static java.lang.String MC
           
 
Constructor Summary
LicenseValidator()
           
 
Method Summary
static boolean a(java.lang.String f)
           
static boolean b(java.lang.String product)
           
static java.lang.String getComponentVersion()
          Returns the version of the MiG Calendar Component.
static int getComponentVersionInt()
          Returns the version of the MiG Calendar Component in a way that earlier version is always less than new versions.
static java.lang.String getProperty(java.lang.String product, java.lang.String propName, java.lang.String defaultProp)
          Returns the property for the key.
static void setLicenseKey(java.io.File file)
          Sets the license key to unlock the component(s).
static void setLicenseKey(java.io.InputStream is)
          Sets the license key to unlock the component(s).
static void setLicenseKey(java.lang.String key)
          Sets the license key to unlock the component(s).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MC

public static final java.lang.String MC
See Also:
Constant Field Values

DBC

public static final java.lang.String DBC
See Also:
Constant Field Values

DBG

public static final java.lang.String DBG
See Also:
Constant Field Values
Constructor Detail

LicenseValidator

public LicenseValidator()
Method Detail

getComponentVersion

public static java.lang.String getComponentVersion()
Returns the version of the MiG Calendar Component. E.g. "5.21", "5.5 RC-1" or "5.5 beta 2005-07-19"

Returns:
The version. Never null.

getComponentVersionInt

public static int getComponentVersionInt()
Returns the version of the MiG Calendar Component in a way that earlier version is always less than new versions.

Returns:
The version. In the format major_minor_micro. E.g. 612 for version 6.1.2.

setLicenseKey

public static void setLicenseKey(java.lang.String key)
Sets the license key to unlock the component(s). This method may be called for setting license for more than one component.

Parameters:
key - The license key. Not null. NOT A FILENAME!!
Throws:
java.lang.IllegalAccessError - If license key not valid. Shows a dialog first.

setLicenseKey

public static void setLicenseKey(java.io.File file)
Sets the license key to unlock the component(s). This method may be called for setting license for more than one component.

Parameters:
file - The file to read the key from. E.g. new File(filename)
Throws:
java.lang.IllegalAccessError - If license key not valid. Shows a dialog first.

setLicenseKey

public static void setLicenseKey(java.io.InputStream is)
Sets the license key to unlock the component(s). This method may be called for setting license for more than one component.

Parameters:
is - The stream to read the key from. E.g. new FileInputStream(filename)
Throws:
java.lang.IllegalAccessError - If license key not valid. Shows a dialog first.

getProperty

public static java.lang.String getProperty(java.lang.String product,
                                           java.lang.String propName,
                                           java.lang.String defaultProp)
Returns the property for the key.

Parameters:
product - The product.
propName - The name of the property
defaultProp - The default value to return if no license entered or the property doen't exist in the license.
Returns:
The property for the key.

b

public static boolean b(java.lang.String product)

a

public static boolean a(java.lang.String f)


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.