List of usage examples for java.lang Boolean toString
public static String toString(boolean b)
From source file:net.sourceforge.fenixedu.dataTransferObject.inquiries.StudentTeacherInquiryBean.java
public String validateTeacherInquiry() { String validationResult = null; for (InquiryBlockDTO inquiryBlockDTO : getTeacherInquiryBlocks()) { validationResult = inquiryBlockDTO.validate(getTeacherInquiryBlocks()); if (!Boolean.valueOf(validationResult)) { return validationResult; }//ww w . j ava 2 s .c o m } return Boolean.toString(true); }
From source file:com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.DeckProfileFactory.java
@Override protected void setProfile(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) { StringResource configTemplate = new StringResource(profile.getBaseContents()); UiSecurity uiSecurity = deploymentConfiguration.getSecurity().getUiSecurity(); Features features = deploymentConfiguration.getFeatures(); Map<String, String> bindings = new HashMap<>(); // Configure global settings bindings.put("gate.baseUrl", endpoints.getServices().getGate().getBaseUrl()); bindings.put("timezone", deploymentConfiguration.getTimezone()); bindings.put("version", deploymentConfiguration.getVersion()); // Configure feature-flags bindings.put("features.auth", Boolean.toString(features.isAuth(deploymentConfiguration))); bindings.put("features.chaos", Boolean.toString(features.isChaos())); bindings.put("features.fiat", Boolean.toString(features.isFiat())); bindings.put("features.jobs", Boolean.toString(features.isJobs())); // Configure Kubernetes KubernetesProvider kubernetesProvider = deploymentConfiguration.getProviders().getKubernetes(); bindings.put("kubernetes.default.account", kubernetesProvider.getPrimaryAccount()); bindings.put("kubernetes.default.namespace", "default"); bindings.put("kubernetes.default.proxy", "localhost:8001"); // Configure GCE GoogleProvider googleProvider = deploymentConfiguration.getProviders().getGoogle(); bindings.put("google.default.account", googleProvider.getPrimaryAccount()); bindings.put("google.default.region", "us-central1"); bindings.put("google.default.zone", "us-central1-f"); // Configure Appengine AppengineProvider appengineProvider = deploymentConfiguration.getProviders().getAppengine(); bindings.put("appengine.default.account", appengineProvider.getPrimaryAccount()); bindings.put("appengine.enabled", Boolean.toString(appengineProvider.getPrimaryAccount() != null)); // Configure Openstack OpenstackProvider openstackProvider = deploymentConfiguration.getProviders().getOpenstack(); bindings.put("openstack.default.account", openstackProvider.getPrimaryAccount()); if (openstackProvider.getPrimaryAccount() != null) { OpenstackAccount openstackAccount = (OpenstackAccount) accountService.getProviderAccount( deploymentConfiguration.getName(), "openstack", openstackProvider.getPrimaryAccount()); //Regions in openstack are a comma separated list. Use the first as primary. String firstRegion = StringUtils.substringBefore(openstackAccount.getRegions(), ","); bindings.put("openstack.default.region", firstRegion); }/*from w w w . j a va2s .c o m*/ profile.appendContents(configTemplate.setBindings(bindings).toString()) .setRequiredFiles(processRequiredFiles(uiSecurity)); }
From source file:gov.nih.nci.calims2.taglib.form.ButtonTag.java
/** * {@inheritDoc}/* w ww . ja v a 2 s . co m*/ */ protected Tag createTag() throws JspTagException { Tag buttonTag = new CompositeTag(HtmlElement.DIV); buttonTag.addAttribute("dojoType", dojoType.getTypeName()); buttonTag.addAttribute("iconClass", iconClass); addAttributes(buttonTag); addBody(buttonTag); addLabel(buttonTag); addUrl(buttonTag); if (dojoType != DojoType.DIJIT_FORM_BUTTON) { buttonTag.addAttribute("checked", Boolean.toString(checked)); } return buttonTag; }
From source file:com.mockey.ui.ConfigurationInfoAJAXServlet.java
/** * /* w w w. ja v a 2s . c o m*/ * * @param req * basic request * @param resp * basic resp * @throws ServletException * basic * @throws IOException * basic */ public void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { ProxyServerModel proxyInfo = store.getProxy(); String transientState = req.getParameter("transient_state"); try { if (transientState != null) { store.setReadOnlyMode(new Boolean(transientState)); } } catch (Exception e) { logger.error("Unable to set transient state with value: " + transientState, e); } resp.setContentType("application/json"); PrintWriter out = resp.getWriter(); try { JSONObject responseObject = new JSONObject(); JSONObject messageObject = new JSONObject(); messageObject.put("proxy_enabled", Boolean.toString(proxyInfo.isProxyEnabled())); messageObject.put("transient_state", store.getReadOnlyMode()); Long twistInfoId = store.getUniversalTwistInfoId(); TwistInfo twistInfo = store.getTwistInfoById(twistInfoId); if (twistInfo != null) { messageObject.put("twist_enabled", true); messageObject.put("twist-id", twistInfo.getId()); messageObject.put("twist-name", twistInfo.getName()); } else { messageObject.put("twist_enabled", false); } resp.setContentType("application/json;"); responseObject.put("result", messageObject); out.println(responseObject.toString()); } catch (JSONException e) { throw new ServletException(e); } out.flush(); out.close(); return; }
From source file:de.codesourcery.jasm16.ide.WorkspaceConfig.java
public void projectOpened(IAssemblyProject project) { configProperties.put(createProjectStateKey(project), Boolean.toString(true)); }
From source file:com.sybase365.mobiliser.custom.project.handlers.authentication.CustomAuthenticationHandler.java
/** * Checks it the authentication token equals the transaction amount * * @throws AuthenticationException//from www . j a v a 2s. com * * {@link com.sybase365.mobiliser.money.businesslogic.authentication.api.IAuthenticationHandler#authenticate(SubTransaction, String, boolean)} */ @Override public void authenticate(final SubTransaction transaction, final String authToken, final boolean payer) throws AuthenticationException { LOG.debug("#authenticate(subtransaction = {}, authToken = {}, isPayer = {})", new Object[] { transaction.toString(), "xxxx", Boolean.toString(payer) }); long amount = transaction.getSubAmount(); LOG.trace("using amount #{}", Long.valueOf(amount)); if (authToken == null || authToken.equals("")) { LOG.debug("The given token was empty/null. Authentication is retrieable"); throw new AuthenticationFailedException(StatusCodes.ERROR_TXN_AUTH_WRONG); } try { long token = Long.parseLong(authToken); if (token == amount) { LOG.debug("Token matched amount"); return; } else if (token % 10 == 0) { LOG.debug("Token ended with 0 - allowing retry"); throw new AuthenticationFailedException(StatusCodes.ERROR_TXN_AUTH_WRONG); } else { LOG.debug("Token wrong - failing transaction"); throw new AuthenticationFailedPermanentlyException(StatusCodes.ERROR_TXN_AUTH_WRONG_FINAL); } } catch (final NumberFormatException ex) { LOG.debug("Could not parse token; must be a number!"); throw new AuthenticationFailedPermanentlyException(StatusCodes.ERROR_TXN_AUTH_WRONG_FINAL); } }
From source file:at.molindo.notify.channel.mail.SimpleMailClient.java
protected Session createSmtpSession() { final Properties props = new Properties(); props.setProperty("mail.smtp.host", _server); props.setProperty("mail.smtp.port", Integer.toString(_port != null ? _port : _security.getDefaultPort())); props.setProperty("mail.smtp.auth", Boolean.toString(_user != null)); if (_security == Security.TLS) { props.setProperty("mail.smtp.starttls.enable", "true"); } else if (_security == Security.SSL) { props.put("mail.smtp.ssl", "true"); props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); }/*w ww . j ava 2s . co m*/ // props.put("mail.debug", "true"); return Session.getInstance(props, new javax.mail.Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { if (_user != null) { return new PasswordAuthentication(_user, _password); } else { return null; } } }); }
From source file:com.eviware.soapui.impl.wsdl.actions.project.AddWsdlAction.java
public void perform(WsdlProject project, Object param) { if (dialog == null) { dialog = ADialogBuilder.buildDialog(Form.class); dialog.setValue(Form.CREATEREQUEST, Boolean.toString(true)); dialog.getFormField(Form.INITIALWSDL).addFormFieldListener(new XFormFieldListener() { public void valueChanged(XFormField sourceField, String newValue, String oldValue) { String value = newValue.toLowerCase().trim(); dialog.getFormField(Form.CREATEREQUEST).setEnabled(value.length() > 0); dialog.getFormField(Form.GENERATEMOCKSERVICE).setEnabled(newValue.trim().length() > 0); dialog.getFormField(Form.GENERATETESTSUITE).setEnabled(newValue.trim().length() > 0); }//from ww w.j a v a 2 s.c o m }); } else { dialog.setValue(Form.INITIALWSDL, ""); dialog.getFormField(Form.CREATEREQUEST).setEnabled(false); dialog.getFormField(Form.GENERATEMOCKSERVICE).setEnabled(false); dialog.getFormField(Form.GENERATETESTSUITE).setEnabled(false); } while (dialog.show()) { try { String url = dialog.getValue(Form.INITIALWSDL).trim(); if (StringUtils.hasContent(url)) { String expUrl = PathUtils.expandPath(url, project); File wsdl = new File(expUrl); if (wsdl.exists()) url = wsdl.toURI().toURL().toString(); log.info("importing: " + expUrl); WsdlInterface[] results = importWsdl(project, expUrl); if (!url.equals(expUrl)) for (WsdlInterface iface : results) iface.setDefinition(url, false); break; } } catch (Exception ex) { UISupport.showErrorMessage(ex); } } }
From source file:fr.unistra.di.metier.dip.ent.portal.portlets.aboutiframe.ConfigDAO.java
/** * Save Web Form into {@link PortletPreferences} * @param form// w w w. ja v a 2s .c om * @param preferences * @see PortletPreferences#setValue(String, String) * @see PortletPreferences#reset(String) */ protected void saveFormData(ConfigForm form, PortletPreferences preferences) { log.debug("Save PortletPreferences"); try { preferences.setValue("url", form.getUrl()); preferences.setValue("about", form.getAbout()); if (form.isOpenExternal()) preferences.setValue("openExternal", Boolean.toString(form.isOpenExternal())); else preferences.reset("openExternal"); for (Map.Entry<String, Attr> attr : form.getAttrs().entrySet()) if (attr.getValue().isEnabled()) preferences.setValue(attr.getKey(), attr.getValue().getValue()); else preferences.reset(attr.getKey()); preferences.store(); } catch (ReadOnlyException ex) { log.error(ex); } catch (ValidatorException ex) { log.error(ex); } catch (IOException ex) { log.error(ex); } }
From source file:de.tor.tribes.ui.algo.SettingsPanel.java
public void storeProperties() { UserProfile profile = GlobalOptions.getSelectedProfile(); profile.addProperty("attack.frame.start", Long.toString(timeSettingsPanel.getStartTime().getTime())); profile.addProperty("attack.frame.arrive", Long.toString(timeSettingsPanel.getArriveTime().getTime())); String spanProp = ""; for (TimeSpan span : timeSettingsPanel.getTimeSpans()) { spanProp += span.toPropertyString() + ";"; }//from w w w. ja v a 2 s . com profile.addProperty("attack.frame.spans", spanProp); profile.addProperty("attack.frame.algo.type", Integer.toString(jAlgoBox.getSelectedIndex())); profile.addProperty("attack.frame.fake.off.targets", Boolean.toString(jFakeOffTargetsBox.isSelected())); }