Package com.iizix.license
Class LicenseSystem
java.lang.Object
com.iizix.license.LicenseSystem
Instance used to load the license system.
- Author:
- Christopher Mindus
- Field SummaryFields
- Method SummaryModifier and TypeMethodDescription- static void- assignWebServerRoot- (File root) Assigns the web server root directory for the license system.- void- cleanUp()Cleans up any temporary files and directories.- static String- formatProduct- (int product) Formats the product.- static LicenseSystemGets the instance of license system.- static LicenseSystem- getInstance- (Object caller) Gets the instance of license system.- <T> T- getInstanceImplementation- (Object caller, Class<T> implClass) Gets the instance of the license system implementation.- static StringConverts a profile picture file of file extension ".png", ".jpg" or ".jpeg" to a Base64 encoded string with the file name.- static byte[]- getProfilePictureFromString- (String string, StringBuilder buf) Returns a Base64 encoded profile picture as a byte array that can be written to file.- booleanPrepares the license system.- booleanPrepares the license system.
- Field Details- PRODUCTSThe product names according to:- 0=other, 
 1=designer,
 2=development server,
 3=standard production server,
 4=container production server (JakartaEE or other), or
 5=cluster.
 
- Method Details- formatProductFormats the product.- Parameters:
- product- The produce code as:- 0=other, 
 1=designer,
 2=development server,
 3=standard production server,
 4=container production server (JakartaEE or other), or
 5=cluster.
- Returns:
- The name of the product.
 
- getInstanceGets the instance of license system.- Returns:
- The instance of the LicenseSystem.
 
- getInstanceGets the instance of license system.- Parameters:
- caller- The special caller Object for testing, null for none.
- Returns:
- The instance of the LicenseSystem.
 
- assignWebServerRootAssigns the web server root directory for the license system.- Parameters:
- root- The root directory.
 
- preparePrepares the license system.- Parameters:
- lock- The lock object for synchronization.
- Returns:
- Success flag (or failure).
- Throws:
- IOException- For I/O exception preparing the license system.
 
- preparePrepares the license system.- Parameters:
- lock- The lock object for synchronization.
- loader- The class used for class loading, null for default.
- Returns:
- Success flag (or failure).
- Throws:
- IOException- For I/O exception preparing the license system.
 
- getInstanceImplementationGets the instance of the license system implementation.- Parameters:
- caller- The caller.
- implClass- The implementation interface class.
- Throws:
- Throwable- For errors in initialization.
 
- cleanUppublic void cleanUp()Cleans up any temporary files and directories.
- getProfilePictureAsStringConverts a profile picture file of file extension ".png", ".jpg" or ".jpeg" to a Base64 encoded string with the file name.- Parameters:
- file- The profile picture file (maximum size 1 MB).
- Returns:
- The Base64 encoded String that includes the file name part.
- Throws:
- FileNotFoundException- If file is not found.
- IOException- For read errors.
 
- getProfilePictureFromStringpublic static byte[] getProfilePictureFromString- (String string, StringBuilder buf) throws IOException Returns a Base64 encoded profile picture as a byte array that can be written to file.- Parameters:
- string- The Base64 encoded string of the profile picture.
- buf- Buffer that is filled with the file name upon return, null for none (file name is ignored).
- Throws:
- IOException- If the string is badly encoded.