@Override public String getProjectName() { return getConfiguration().getString(PROJECT_NAME_KEY); }
@Override public String getProjectGroupName() { return getConfiguration().getString(PROJECT_GROUP_NAME_KEY); }
@Override public String getProjectVersion() { return getConfiguration().getString(PROJECT_VERSION_KEY); }
private String getTargetDir() { String target = this.config.getString(FacesScaffoldProvider.class.getName() + "_targetDir"); target = Strings.isNullOrEmpty(target) ? "" : target; if (!target.startsWith("/")) { target = "/" + target; } if (target.endsWith("/")) { target = target.substring(0, target.length() - 1); } return target; }
public String toOptionName(String name) { String optionNameStyle = userConfig.getString(OPTION_STYLE_PROPERTY, DASHED_OPTION_STYLE); return DASHED_OPTION_STYLE.equals(optionNameStyle) ? ShellUtil.shellifyOptionNameDashed(name) : ShellUtil.shellifyOptionName(name); } }
@Override public Map<String, String> getDirectProperties() { Configuration subset = getConfiguration().subset(PROPERTIES_SUBSET_KEY); Map<String, String> map = new LinkedHashMap<>(); subset.getKeys().forEachRemaining((key) -> map.put(key, subset.getString(key))); return map; }
public File localRepository() { Configuration user = userConfig(); if (user.containsKey(CLONE_LOCATION_KEY)) { return new File(user.getString(CLONE_LOCATION_KEY)); } return defaultLocalRepository(); }
private File getUserProvidedRulesFolder() { if (supplementalRulesFolder.getValue() != null) { File userProvidedRulesFolderFile = supplementalRulesFolder.getValue().getUnderlyingResourceObject(); configuration.setProperty(KEY_SUPPLEMENTAL_RULES_DIRECTORY, userProvidedRulesFolderFile.getAbsolutePath()); return userProvidedRulesFolderFile; } else { String userProvidedRulesFolder = configuration.getString(KEY_SUPPLEMENTAL_RULES_DIRECTORY); if (StringUtils.isEmpty(userProvidedRulesFolder)) { Path windupConfigHomePath = SharedProperties.getWindupConfigurationDirectory(); return windupConfigHomePath.resolve(".windup").resolve("rules").toFile(); } else { return new File(userProvidedRulesFolder); } } }
/** * Registers the {@link ArchetypeCatalogFactory} objects from the user {@link Configuration} */ @Override protected void handleThisPostStartup() { services = SimpleContainer.getServices(getClass().getClassLoader(), ArchetypeCatalogFactory.class); Configuration archetypeConfiguration = getArchetypeConfiguration(); Iterator<?> keys = archetypeConfiguration.getKeys(); while (keys.hasNext()) { String name = keys.next().toString(); if (!name.isEmpty()) { String url = archetypeConfiguration.getString(name); try { addArchetypeCatalogFactory(name, new URL(url)); } catch (MalformedURLException e) { log.log(Level.SEVERE, "Malformed URL for " + name, e); } } } }
public String remoteRepository() { Configuration user = userConfig(); if (user.containsKey(REPOSITORY_KEY)) { return user.getString(REPOSITORY_KEY); } return defaultRemoteRepository(); }
@Override public String removeDirectProperty(String name) { Configuration subset = getConfiguration().subset(PROPERTIES_SUBSET_KEY); String value = subset.getString(name); subset.clearProperty(name); return value; }
@Override public void initializeUI(UIBuilder builder) throws Exception { InputComponentFactory inputFactory = builder.getInputComponentFactory(); sources = inputFactory.createInputMany("sources", 's', FileResource.class); sources.setDescription("The folder or file where the java sources will be formatted"); profilepath = inputFactory.createInput("profilepath", 'p', XMLResource.class); profilepath.setDescription("The eclipse code format profile"); profilename = inputFactory.createInput("profilename", 'n', String.class); profilename.setDescription("The eclipse code format profile name"); Furnace furnace = SimpleContainer.getFurnace(this.getClass().getClassLoader()); Configuration userConfig = furnace.getAddonRegistry().getServices(Configuration.class).get(); ResourceFactory resourceFactory = furnace.getAddonRegistry().getServices(ResourceFactory.class).get(); String profileName = userConfig.getString(JavaResource.FORMATTER_PROFILE_NAME_KEY); if (!Strings.isNullOrEmpty(profileName)) { profilename.setDefaultValue(profileName); } String path = userConfig.getString(JavaResource.FORMATTER_PROFILE_PATH_KEY); if (!Strings.isNullOrEmpty(path)) { XMLResource resource = resourceFactory.create(XMLResource.class, new File(path)); profilepath.setDefaultValue(resource); } builder.add(sources).add(profilepath).add(profilename); }
String connectionProfiles = config.getString("connection-profiles"); if (connectionProfiles != null)