Example usage for java.lang Boolean toString

List of usage examples for java.lang Boolean toString

Introduction

In this page you can find the example usage for java.lang Boolean toString.

Prototype

public static String toString(boolean b) 

Source Link

Document

Returns a String object representing the specified boolean.

Usage

From source file:com.redhat.rcm.nexus.security.NxSecConfiguration.java

public void load() throws ConfigurationException {
    File configFile = new File(appConfiguration.getConfigurationDirectory(), NX_SEC_CONFIG_FILE);
    if (configFile.exists() && configFile.canRead()) {
        FileInputStream fis = null;
        try {// www. j a v  a 2 s .c  om
            fis = new FileInputStream(configFile);
            Properties props = new Properties();
            props.load(fis);

            autoCreateEnabled = Boolean.valueOf(
                    props.getProperty(KEY_AUTOCREATE_ENABLED, Boolean.toString(DEFAULT_AUTOCREATE_ENABLED)));

            autoCreateEmailDomain = props.getProperty(KEY_AUTOCREATE_EMAIL_DOMAIN,
                    DEFAULT_AUTOCREATE_EMAIL_DOMAIN);

            templateUserId = props.getProperty(KEY_TEMPLATE_USER_ID);

            if (isBlank(autoCreateEmailDomain)) {
                autoCreateEmailDomain = DEFAULT_AUTOCREATE_EMAIL_DOMAIN;
            }

            loaded = true;
        } catch (IOException e) {
            loaded = false;
            throw new ConfigurationException("Cannot read " + configFile + ". Reason: " + e.getMessage(), e);
        } finally {
            closeQuietly(fis);
        }
    }
}

From source file:fr.paris.lutece.plugins.workflow.modules.rest.service.formatters.ActionResultFormatterJson.java

/**
 * {@inheritDoc }//w w w.  j a  v a 2 s. co m
 */
@Override
public String format(IActionResult actionResult) {
    JSONObject jsonObject = new JSONObject();

    jsonObject.element(WorkflowRestConstants.TAG_IS_SUCCESSFUL, Boolean.toString(actionResult.isSuccessful()));
    jsonObject.element(WorkflowRestConstants.TAG_ID_ACTION, actionResult.getIdAction());
    jsonObject.element(WorkflowRestConstants.TAG_ID_RESOURCE, actionResult.getIdResource());
    jsonObject.element(WorkflowRestConstants.TAG_RESOURCE_TYPE, actionResult.getResourceType());
    jsonObject.element(WorkflowRestConstants.TAG_MESSAGE, actionResult.getMessage());

    return jsonObject.toString();
}

From source file:com.jaspersoft.jasperserver.api.engine.jasperreports.util.AwsPropertyChanger.java

@Override
public String getProperty(String key) {
    assert (key.startsWith(PROPERTY_PREFIX));
    log.debug("getting AWS property: " + key);
    if (AwsProperties.DB_SECURITY_GROUP_CHANGES_ENABLED.equals(key)) {
        return Boolean.toString(awsProperties.isSecurityGroupChangesEnabled());
        //return Boolean.toString(awsDataSourceRecovery.isSecurityGroupChangesEnabled());
    } else if (AwsProperties.DB_SECURITY_GROUP_NAME.equals(key)) {
        return awsProperties.getSecurityGroupName();
        //return awsDataSourceRecovery.getSecurityGroupName();
    } else if (AwsProperties.DB_SECURITY_GROUP_DESCRIPTION.equals(key)) {
        return awsProperties.getSecurityGroupDescription();
        //return awsDataSourceRecovery.getSecurityGroupDescription();
    } else if (AwsProperties.DB_SECURITY_GROUP_INGRESS_PUBLIC_IP.equals(key)) {
        return awsProperties.getSecurityGroupIngressPublicIp();
        //return awsDataSourceRecovery.getSecurityGroupIngressPublicIp();
    } else if (AwsProperties.DB_SECURITY_GROUP_CHANGES_SUPPRESS_EC2_CREDENTIALS_WARNINGS.equals(key)) {
        return Boolean.toString(awsProperties.isSuppressEc2CredentialsWarnings());
        //return Boolean.toString(awsDataSourceRecovery.isSuppressEc2CredentialsWarnings());
    } else {//from   w ww  .  j  av a2s. c  om
        throw new RuntimeException("Unknown AWS config property: " + key);
    }
}

From source file:com.dangdang.ddframe.job.cloud.scheduler.mesos.TaskInfoData.java

private Map<String, String> buildJobConfigurationContext() {
    Map<String, String> result = new LinkedHashMap<>(16, 1);
    result.put("jobType", jobConfig.getTypeConfig().getJobType().name());
    result.put("jobName", jobConfig.getJobName());
    result.put("jobClass", jobConfig.getTypeConfig().getJobClass());
    result.put("cron",
            CloudJobExecutionType.DAEMON == jobConfig.getJobExecutionType()
                    ? jobConfig.getTypeConfig().getCoreConfig().getCron()
                    : "");
    result.put("jobExceptionHandler", jobConfig.getTypeConfig().getCoreConfig().getJobProperties()
            .get(JobProperties.JobPropertiesEnum.JOB_EXCEPTION_HANDLER));
    result.put("executorServiceHandler", jobConfig.getTypeConfig().getCoreConfig().getJobProperties()
            .get(JobProperties.JobPropertiesEnum.EXECUTOR_SERVICE_HANDLER));
    if (jobConfig.getTypeConfig() instanceof DataflowJobConfiguration) {
        result.put("streamingProcess",
                Boolean.toString(((DataflowJobConfiguration) jobConfig.getTypeConfig()).isStreamingProcess()));
    } else if (jobConfig.getTypeConfig() instanceof ScriptJobConfiguration) {
        result.put("scriptCommandLine",
                ((ScriptJobConfiguration) jobConfig.getTypeConfig()).getScriptCommandLine());
    }//from  w w  w.j  av a  2 s. c o  m
    result.put("beanName", jobConfig.getBeanName());
    result.put("applicationContext", jobConfig.getApplicationContext());
    return result;
}

From source file:org.graylog2.inputs.twitter.TwitterCodec.java

private Message createMessageFromStatus(final Status status) {
    final Message message = new Message(status.getText(), "twitter.com", new DateTime(status.getCreatedAt()));

    message.addField("facility", "Tweets");
    message.addField("level", 6);
    message.addField("tweet_id", status.getId());
    message.addField("tweet_is_retweet", Boolean.toString(status.isRetweet()));
    message.addField("tweet_favorite_count", status.getFavoriteCount());
    message.addField("tweet_retweet_count", status.getRetweetCount());
    message.addField("tweet_language", status.getLang());

    final GeoLocation geoLocation = status.getGeoLocation();
    if (geoLocation != null) {
        message.addField("tweet_geo_long", geoLocation.getLongitude());
        message.addField("tweet_geo_lat", geoLocation.getLatitude());
    }//w w  w  . java2  s .  c om

    final User user = status.getUser();
    if (user != null) {
        message.addField("tweet_url",
                "https://twitter.com/" + user.getScreenName() + "/status/" + status.getId());
        message.addField("user_id", user.getId());
        message.addField("user_name", user.getScreenName());
        message.addField("user_description", user.getDescription());
        message.addField("user_timezone", user.getTimeZone());
        message.addField("user_utc_offset", user.getUtcOffset());
        message.addField("user_location", user.getLocation());
        message.addField("user_language", user.getLang());
        message.addField("user_url", user.getURL());
        message.addField("user_followers", user.getFollowersCount());
        message.addField("user_tweets", user.getStatusesCount());
        message.addField("user_favorites", user.getFavouritesCount());
    }
    return message;
}

From source file:net.indialend.attendance.controller.APIController.java

@RequestMapping("/updateStaff")
@ResponseBody
public String saveStaff(Staff staff) {

    return Boolean.toString(staffService.saveStaff(staff));
}

From source file:com.thruzero.common.core.map.StringMap.java

public void putBoolean(final String key, final boolean value) {
    put(key, Boolean.toString(value));
}

From source file:mSearch.filmlisten.WriteFilmlistJson.java

public void filmlisteSchreibenJson(String datei, ListeFilme listeFilme) {

    ZipOutputStream zipOutputStream = null;
    XZOutputStream xZOutputStream = null;
    JsonGenerator jg = null;//  ww w  . j a v a 2  s  . com

    FileWriter fileWriter = null;
    CSVPrinter csvFilePrinter = null;
    try {
        Log.sysLog("Filme schreiben (" + listeFilme.size() + " Filme) :");
        File file = new File(datei);
        File dir = new File(file.getParent());
        if (!dir.exists()) {
            if (!dir.mkdirs()) {
                Log.errorLog(915236478, "Kann den Pfad nicht anlegen: " + dir.toString());
            }
        }
        Log.sysLog("   --> Start Schreiben nach: " + datei);

        CSVFormat csvFileFormat = CSVFormat.DEFAULT.withDelimiter(';').withQuote('\'')
                .withRecordSeparator("\n");
        fileWriter = new FileWriter(datei);
        csvFilePrinter = new CSVPrinter(fileWriter, csvFileFormat);

        // Infos der Felder in der Filmliste
        csvFilePrinter.printRecord(DatenFilm.COLUMN_NAMES);

        //Filme schreiben
        DatenFilm datenFilm;
        Iterator<DatenFilm> iterator = listeFilme.iterator();
        while (iterator.hasNext()) {
            datenFilm = iterator.next();
            datenFilm.arr[DatenFilm.FILM_NEU] = Boolean.toString(datenFilm.isNew()); // damit wirs beim nchsten Programmstart noch wissen

            List<String> filmRecord = new ArrayList<String>();
            for (int i = 0; i < DatenFilm.JSON_NAMES.length; ++i) {
                int m = DatenFilm.JSON_NAMES[i];
                filmRecord.add(datenFilm.arr[m].replace("\n", "").replace("\r", ""));
            }
            csvFilePrinter.printRecord(filmRecord);
        }
        Log.sysLog("   --> geschrieben!");
    } catch (Exception ex) {
        Log.errorLog(846930145, ex, "nach: " + datei);
    } finally {
        try {
            fileWriter.flush();
            fileWriter.close();
            csvFilePrinter.close();
        } catch (Exception e) {
            Log.errorLog(732101201, e, "close stream: " + datei);
        }
    }
}

From source file:ph.fingra.statisticsweb.controller.SignupController.java

@RequestMapping(method = RequestMethod.GET, value = "/signup/duplicateEmailCheck")
public @ResponseBody String duplicateEmailCheck(@RequestParam("email") String email) {

    if (email.equals(adminEmail))
        return Boolean.toString(false);

    return Boolean.toString(!memberService.duplicateEmailCheck(email));
}

From source file:eu.fbk.dkm.sectionextractor.WikipediaSectionTitlesExtractor.java

public WikipediaSectionTitlesExtractor(int numThreads, int numPages, Locale locale, File outFile,
        Integer configuredDepth, int maxNum, boolean printTitles, HashSet<String> pagesToConsider) {
    super(numThreads, numPages, locale);

    logger.info("Locale: " + locale);
    logger.info("Page to consider: " + pagesToConsider.size());
    logger.info("Configured depth: " + configuredDepth);
    logger.info("Max number of sections: " + maxNum);
    logger.info("Print titles: " + Boolean.toString(printTitles));
    logger.info("Output file: " + outFile);

    this.configuredDepth = configuredDepth;
    this.maxNum = maxNum;
    this.printTitles = printTitles;
    this.pagesToConsider = pagesToConsider;

    try {/*from ww  w. j  a v a  2s.  c  o m*/
        writer = new BufferedWriter(new FileWriter(outFile));
    } catch (Exception e) {
        logger.error(e.getMessage());
    }
}