Example usage for java.lang String concat

List of usage examples for java.lang String concat

Introduction

In this page you can find the example usage for java.lang String concat.

Prototype

public String concat(String str) 

Source Link

Document

Concatenates the specified string to the end of this string.

Usage

From source file:com.crankworks.cycletracks.TripUploader.java

public String getDeviceId() {
    String androidId = System.getString(this.mCtx.getContentResolver(), Secure.ANDROID_ID);
    String androidBase = "androidDeviceId-";

    if (androidId == null) { // This happens when running in the Emulator
        final String emulatorId = "android-RunningAsTestingDeleteMe";
        return emulatorId;
    }//from  ww w  .j  av a 2 s . com
    String deviceId = androidBase.concat(androidId);
    return deviceId;
}

From source file:org.lcog.cyclelane.TripUploader.java

public String getDeviceId() {
    String androidId = System.getString(this.mCtx.getContentResolver(), System.ANDROID_ID);
    String androidBase = "androidDeviceId-";

    if (androidId == null) { // This happens when running in the Emulator
        final String emulatorId = "android-RunningAsTestingDeleteMe";
        return emulatorId;
    }/*from  w ww  .  j a v  a 2  s.  co  m*/
    String deviceId = androidBase.concat(androidId);
    return deviceId;
}

From source file:io.github.xfally.cordova.plugin.ftp.CDVFtp.java

private void createDirectory(String path, CallbackContext callbackContext) {
    if (path == null) {
        callbackContext.error("Expected path.");
    } else {/*  w  w w.j  a v  a  2 s  .  c o  m*/
        if (!path.endsWith("/")) {
            path = path.concat("/");
        }

        try {
            this.client.changeDirectory(this.rootPath);
            this.client.createDirectory(path);
            callbackContext.success("Create directory OK");
        } catch (Exception e) {
            callbackContext.error(e.toString());
        }
    }
}

From source file:io.github.xfally.cordova.plugin.ftp.CDVFtp.java

private void deleteDirectory(String path, CallbackContext callbackContext) {
    if (path == null) {
        callbackContext.error("Expected path.");
    } else {/*from  ww  w .j  a v  a 2 s. c om*/
        if (!path.endsWith("/")) {
            path = path.concat("/");
        }

        try {
            this.client.changeDirectory(this.rootPath);
            this.client.deleteDirectory(path);
            callbackContext.success("Delete directory OK");
        } catch (Exception e) {
            callbackContext.error(e.toString());
        }
    }
}

From source file:info.ajaxplorer.client.http.AjxpAPI.java

public URI getStatUri(String path) throws URISyntaxException {
    String url = getGetActionUrl("stat");
    try {/*  w w  w  . j ava 2  s  .  c  o  m*/
        url = url.concat("file=" + java.net.URLEncoder.encode(path, "UTF-8"));
        return returnUriFromString(url);
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
        return null;
    }
}

From source file:SciTK.PlotXYError.java

/** Get a string representation of the plotted data 
* @return the data plotted in CSV format.
*//*w  w w . jav a  2s.c o  m*/
public String toString() {
    String s = "";
    // iterate over all data series:
    for (int i = 0; i < data.getSeriesCount(); i++) {
        // iterate over items in the series:
        for (int j = 0; j < data.getItemCount(i); j++) {
            // add x,y then new line:
            s = s.concat(Double.toString(data.getXValue(i, j)));
            s = s.concat(SciTK_Text.TOOLKIT_CSV_DELIM);
            s = s.concat(Double.toString(data.getStartXValue(i, j)));
            s = s.concat(SciTK_Text.TOOLKIT_CSV_DELIM);
            s = s.concat(Double.toString(data.getEndXValue(i, j)));
            s = s.concat(SciTK_Text.TOOLKIT_CSV_DELIM);
            s = s.concat(Double.toString(data.getYValue(i, j)));
            s = s.concat(SciTK_Text.TOOLKIT_CSV_DELIM);
            s = s.concat(Double.toString(data.getStartYValue(i, j)));
            s = s.concat(SciTK_Text.TOOLKIT_CSV_DELIM);
            s = s.concat(Double.toString(data.getEndYValue(i, j)));
            s = s.concat(SciTK_Text.TOOLKIT_NEWLINE);
        }
        // add another line break after series is done:
        s = s.concat(SciTK_Text.TOOLKIT_NEWLINE);
    }
    return s;
}

From source file:argendata.service.impl.DatasetServiceImpl.java

@Override
public QueryResponse resolveIndexQuery(String terms, String[] facetFields, Map<String, String> filterValuesMap,
        List<String> sortByFields, List<String> listKeywords)
        throws MalformedURLException, SolrServerException {
    String myQuery = "type:dataset AND ((*" + terms + "* OR *" + terms.toLowerCase() + "* OR *"
            + terms.toUpperCase() + "*)OR (description:*" + terms + "* OR description:*" + terms.toLowerCase()
            + "* OR description:*" + terms.toUpperCase() + "))";
    boolean facets = true;
    Integer minCount = 1;/*from   w  ww.  j  a v  a 2  s  .  co m*/

    List<String> filter = new ArrayList<String>();

    if (filterValuesMap != null) {
        Set<String> filtersKey = filterValuesMap.keySet();
        for (String facet : filtersKey) {
            if (!facet.equals("modified") && !facet.equals("size")) {
                String aux = "\"";
                aux = aux.concat(filterValuesMap.get(facet));
                aux = aux.concat("\"");
                filter.add(facet + ":" + aux);
            } else {
                if (facet.equals("modified"))
                    filter.add(facet + "" + getSolrQueryDate(filterValuesMap.get(facet)));
                else
                    filter.add(facet + "" + getSolrQueryExtention(filterValuesMap.get(facet)));
            }
        }
    }
    if (listKeywords != null) {
        for (String kw : listKeywords) {
            filter.add("keyword:" + kw);
        }
    }
    String sortByField = null;
    QueryResponse resp = null;
    if (sortByFields != null) {
        sortByField = sortByFields.get(1);
        if (sortByFields.get(2).equals("a")) {
            resp = solrDao.filterFacetQuery(myQuery, facets, minCount, facetFields, filter, sortByField,
                    ORDER.asc);

        } else {
            resp = solrDao.filterFacetQuery(myQuery, facets, minCount, facetFields, filter, sortByField,
                    ORDER.desc);
        }
    } else {
        resp = solrDao.filterFacetQuery(myQuery, facets, minCount, facetFields, filter, sortByField, ORDER.asc);
    }

    /*Aplicacin de sortBy va JAVA*/

    return resp;
}

From source file:cn.itganhuo.app.service.impl.UserServiceImpl.java

public boolean updatePasswordByAccount(User user) {
    String algorithmName = "SHA-512";
    String salt1 = user.getAccount();
    String salt2 = new SecureRandomNumberGenerator().nextBytes().toHex();
    int hashIterations = 2;
    SimpleHash hash = new SimpleHash(algorithmName, user.getPassword(), salt1.concat(salt2), hashIterations);
    user.setPassword(hash.toBase64());/*from ww  w  . ja  v  a 2s.  c o m*/
    user.setSalt(salt2);
    return this.userDao.updatePasswordByAccount(user);
}

From source file:io.bitsquare.gui.components.paymentmethods.BlockChainForm.java

@Override
protected void autoFillNameTextField() {
    if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
        String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
        String address = addressInputTextField.getText();
        address = StringUtils.abbreviate(address, 9);
        String currency = paymentAccount.getSingleTradeCurrency() != null
                ? paymentAccount.getSingleTradeCurrency().getCode()
                : "?";
        accountNameTextField.setText(method.concat(", ").concat(currency).concat(", ").concat(address));
    }//from   w w w .  j a va  2 s.c  om
}

From source file:info.ajaxplorer.client.http.AjxpAPI.java

public URI getUploadUri(String targetFolder) throws URISyntaxException {
    String url = getGetActionUrl("upload");
    try {//from   w ww . j a  va 2  s . co m
        url = url.concat("dir=" + java.net.URLEncoder.encode(targetFolder, "UTF-8") + "&xhr_uploader=true");
        return returnUriFromString(url);
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
        return null;
    }
}