| | |
| | | } |
| | | |
| | | /** |
| | | * The class name that contains the control panel customizations for |
| | | * products. |
| | | */ |
| | | private final static String CUSTOMIZATION_CLASS_NAME = |
| | | "org.opends.server.util.ReleaseDefinition"; |
| | | |
| | | /** |
| | | * Enumeration that specify if the operation applies to the install directory |
| | | * only, to the instance directory only, or both. |
| | | */ |
| | |
| | | } |
| | | return buffer.toString(); |
| | | } |
| | | |
| | | /** |
| | | * Tries to find a customized message in the customization class. If the |
| | | * customization class does not exist or it does not contain the field |
| | | * as a message, returns the default message. |
| | | * @param <T> the type of the customized object. |
| | | * @param fieldName the name of the field representing a message in the |
| | | * customization class. |
| | | * @param defaultValue the default value. |
| | | * @param valueClass the class of the parametrized value. |
| | | * @return the customized message. |
| | | */ |
| | | public static <T> T getCustomizedObject(String fieldName, |
| | | T defaultValue, Class<T> valueClass) |
| | | { |
| | | T value = defaultValue; |
| | | if (!isWebStart()) |
| | | { |
| | | try |
| | | { |
| | | Class c = Class.forName(Utils.CUSTOMIZATION_CLASS_NAME); |
| | | Object obj = c.newInstance(); |
| | | |
| | | value = valueClass.cast(c.getField(fieldName).get(obj)); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | } |
| | | } |
| | | return value; |
| | | } |
| | | } |
| | | |
| | | /** |