/** * Load GUI preference information. * * @param installData the GUI installation data * @throws Exception */ private void loadGUIInstallData(GUIInstallData installData, Resources resources) throws Exception { installData.guiPrefs = (GUIPrefs) resources.getObject("GUIPrefs"); }
/** * Load GUI preference information. * * @param installData the console installation data * @throws Exception */ private void loadConsoleInstallData(ConsoleInstallData installData, Resources resources) throws Exception { installData.consolePrefs = (ConsolePrefs) resources.getObject("ConsolePrefs"); }
/** * Returns the supported locales. * * @return the supported locales * @throws ResourceException if the supported locales exist but cannot be read */ @SuppressWarnings("unchecked") private List<String> getSupportedLocales() { List<String> locales = null; try { locales = (List<String>) resources.getObject("langpacks.info"); } catch (ResourceNotFoundException ignore) { // do nothing } return (locales != null) ? locales : Collections.<String>emptyList(); }
/** * Reads conditions using the resources. * <p/> * This looks for a serialized resource named <em>"rules"</em>. * * @param resources the resources * @return the conditions, keyed on id, or <tt>null</tt> if the resource doesn't exist or cannot be read */ @SuppressWarnings("unchecked") private Map<String, Condition> readConditions(Resources resources) { Map<String, Condition> rules = null; try { rules = (Map<String, Condition>) resources.getObject("rules"); } catch (ResourceNotFoundException rnfe) { logger.fine("No optional rules defined"); } catch (ResourceException re) { logger.log(Level.SEVERE, "Optional rules could not be loaded", re); } return rules; }
/** * Load installer conditions. * * @param installData the installation data * @throws IOException for any I/O error * @throws ClassNotFoundException if a serialized object's class cannot be found * @throws ResourceNotFoundException if the resource cannot be found */ @SuppressWarnings("unchecked") protected void loadInstallerRequirements(AutomatedInstallData installData, Resources resources) { List<InstallerRequirement> requirements = (List<InstallerRequirement>) resources.getObject("installerrequirements"); installData.setInstallerRequirements(requirements); }
/** * Loads dynamic conditions. * * @param installData the installation data * @param resources the resources */ @SuppressWarnings("unchecked") protected void loadDynamicConditions(AutomatedInstallData installData, Resources resources) { try { List<DynamicInstallerRequirementValidator> conditions = (List<DynamicInstallerRequirementValidator>) resources.getObject("dynconditions"); installData.setDynamicInstallerRequirements(conditions); } catch (Exception e) { logger.log(Level.WARNING, "Cannot find optional dynamic conditions", e); } }
/** * Loads Dynamic Variables. * * @param variables the collection to added variables to * @param installData the installation data */ @SuppressWarnings("unchecked") protected void loadDynamicVariables(Variables variables, InstallData installData, Resources resources) { try { List<DynamicVariable> dynamicVariables = (List<DynamicVariable>) resources.getObject("dynvariables"); for (DynamicVariable dynamic : dynamicVariables) { Value value = dynamic.getValue(); value.setInstallData(installData); variables.add(dynamic); } } catch (Exception e) { logger.log(Level.WARNING, "Cannot find optional dynamic variables", e); } }
public void loadCustomData() List<CustomData> customData = (List<CustomData>) resources.getObject("customData"); for (CustomData data : customData)