private String extractArguments( CleanCachesOption[] cleanCachesOption ) { if( cleanCachesOption.length > 0 ) { Boolean cleanCaches = cleanCachesOption[0].getValue(); if( cleanCaches != null && cleanCaches.booleanValue() ) { return "--clean"; } } return null; }
private Map<String, String> createFrameworkProperties() throws ExamConfigurationException { final Map<String, String> p = new HashMap<>(); CleanCachesOption cleanCaches = system.getOption(CleanCachesOption.class); if (cleanCaches != null && cleanCaches.getValue() != null && cleanCaches.getValue()) { p.put(FRAMEWORK_STORAGE_CLEAN, FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT); } p.put(FRAMEWORK_STORAGE, system.getTempFolder().getAbsolutePath()); p.put(FRAMEWORK_SYSTEMPACKAGES_EXTRA, join(system.getOptions(SystemPackageOption.class))); p.put(FRAMEWORK_BOOTDELEGATION, join(system.getOptions(BootDelegationOption.class))); for (FrameworkPropertyOption option : system.getOptions(FrameworkPropertyOption.class)) { p.put(option.getKey(), (String) option.getValue()); } if (LOG.isDebugEnabled()) { logFrameworkProperties(p); } return p; }
/** * Clears up resources taken by system (like temporary files). */ @Override public void clear() { try { warnUnusedOptions(); if (clean == null || clean.getValue() == Boolean.TRUE) { for (ExamSystem sys : subsystems) { sys.clear(); } FileUtils.delete(cache.getCanonicalFile()); } } catch (IOException e) { // LOG.info("Clearing " + this.toString() + " failed." ,e); } }
private Map<String, String> createFrameworkProperties() throws IOException { final Map<String, String> p = new HashMap<String, String>(); CleanCachesOption cleanCaches = system.getSingleOption(CleanCachesOption.class); if (cleanCaches != null && cleanCaches.getValue() != null && cleanCaches.getValue()) { p.put(FRAMEWORK_STORAGE_CLEAN, FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT); } p.put(FRAMEWORK_STORAGE, system.getTempFolder().getAbsolutePath()); p.put(FRAMEWORK_SYSTEMPACKAGES_EXTRA, buildString(system.getOptions(SystemPackageOption.class))); p.put(FRAMEWORK_BOOTDELEGATION, buildString(system.getOptions(BootDelegationOption.class))); for (FrameworkPropertyOption option : system.getOptions(FrameworkPropertyOption.class)) { p.put(option.getKey(), (String) option.getValue()); } for (SystemPropertyOption option : system.getOptions(SystemPropertyOption.class)) { System.setProperty(option.getKey(), option.getValue()); } String repositories = buildString(system.getOptions(RepositoryOption.class)); if (!repositories.isEmpty()) { System.setProperty("org.ops4j.pax.url.mvn.repositories", repositories); } return p; }