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.cloudant.sync.query.IndexCreator.java

private String createIndexIndexStatementForIndex(String indexName, List<String> columns) {
    String tableName = IndexManager.tableNameForIndex(indexName);
    String sqlIndexName = tableName.concat("_index");
    Joiner joiner = Joiner.on(",").skipNulls();
    String cols = joiner.join(columns);

    return String.format(Locale.ENGLISH, "CREATE INDEX \"%s\" ON \"%s\" ( %s )", sqlIndexName, tableName, cols);
}

From source file:eu.optimis.ecoefficiencytool.core.EcoEffAssessorSP.java

public String getAllDeploymentMessages() {
    String ret = "";
    for (String message : deploymentMessages) {
        ret = ret.concat(message).concat("\n");
    }/*from w  ww  . j a v a  2 s  .  co m*/
    return ret;
}

From source file:de.tudarmstadt.ukp.lmf.transform.germanet.SubcategorizationFrameExtractor.java

/**
 * This method parses syntactic arguments encoded in a line of subcategorization mapping file
 * @param synSemArgs part of the line encoding the arguments
 * @param subcatFrame subcategorization frame to which syntactic arguments should be appended
 * @return subcategorization frame with appended syntactic arguments
 * @see SubcategorizationFrame//ww  w .  j  a  v  a2 s  .co  m
 * @see SyntacticArgument
 */
private SubcategorizationFrame parseArguments(String synSemArgs, SubcategorizationFrame subcatFrame) {
    SubcategorizationFrame scFrame = subcatFrame;
    List<SyntacticArgument> synArgs = new LinkedList<SyntacticArgument>();
    String[] args = synSemArgs.split(":");
    for (String arg : args) {
        if (!arg.contains("syntacticProperty")) {
            SyntacticArgument syntacticArgument = new SyntacticArgument();
            syntacticArgument.setId("GN_SyntacticArgument_".concat(Integer.toString(syntacticArgumentNumber)));
            syntacticArgumentNumber++;
            String[] atts = arg.split(",");
            for (String att : atts) {
                String[] splits = att.split("=");
                String attName = splits[0];
                if (attName.equals("grammaticalFunction")) {
                    // needs some extra care because of incomplete names in the mappings-file...
                    String gf = splits[1];
                    if (gf.endsWith("Comp")) {
                        gf = gf.concat("lement");
                    }
                    syntacticArgument.setGrammaticalFunction(EGrammaticalFunction.valueOf(gf));
                } else if (attName.equals("syntacticCategory")) {
                    syntacticArgument.setSyntacticCategory(ESyntacticCategory.valueOf(splits[1]));
                } else if (attName.equals("optional")) {
                    syntacticArgument.setOptional(splits[1].equals("yes"));
                } else if (attName.equals("case")) {
                    syntacticArgument.setCase(ECase.valueOf(splits[1]));
                } else if (attName.equals("determiner")) {
                    syntacticArgument.setDeterminer(EDeterminer.valueOf(splits[1]));
                } else if (attName.equals("preposition")) {
                    syntacticArgument.setPreposition(splits[1]);
                } else if (attName.equals("prepositionType")) {
                    syntacticArgument.setPrepositionType(splits[1]);
                } else if (attName.equals("number")) {
                    syntacticArgument.setNumber(EGrammaticalNumber.valueOf(splits[1]));
                } else if (attName.equals("lex")) {
                    syntacticArgument.setLexeme(splits[1]);
                } else if (attName.equals("verbForm")) {
                    syntacticArgument.setVerbForm(EVerbForm.valueOf(splits[1]));
                } else if (attName.equals("tense")) {
                    syntacticArgument.setTense(ETense.valueOf(splits[1]));
                } else if (attName.equals("complementizer")) {
                    syntacticArgument.setComplementizer(EComplementizer.valueOf(splits[1]));
                }
            }
            synArgs.add(syntacticArgument);
        } else {
            String[] splits = arg.split("=");
            String sp = splits[1];
            if (sp.equals("raising")) {
                sp = sp.replaceAll("raising", "subjectRaising");
            }
            LexemeProperty lexemeProperty = new LexemeProperty();
            lexemeProperty.setSyntacticProperty(ESyntacticProperty.valueOf(sp));
            scFrame.setLexemeProperty(lexemeProperty);
        }
    }
    scFrame.setSyntacticArguments(synArgs);
    return scFrame;
}

From source file:org.gvnix.support.OperationUtilsImpl.java

/**
 * Installs the Dialog Java class//from w w w.  j av  a2  s .  c  o m
 * 
 * @param packageFullName fullyQualifiedName of destination package for
 *        Dialog Bean. ie. <code>com.disid.myapp.web.dialog</code>
 * @param pathResolver
 * @param fileManager
 * @deprecated Use
 *             {@link WebProjectUtils#installWebDialogClass(String, PathResolver, FileManager)}
 */
@Override
public void installWebDialogClass(String packageFullName, PathResolver pathResolver, FileManager fileManager) {

    String classFullName = pathResolver.getIdentifier(LogicalPath.getInstance(Path.SRC_MAIN_JAVA, ""),
            packageFullName.concat(".Dialog").replace(".", File.separator).concat(".java"));

    installJavaClassFromTemplate(packageFullName, classFullName, "Dialog.java-template", pathResolver,
            fileManager);
}

From source file:com.eucalyptus.auth.login.Hmacv1LoginModule.java

private String makeSubjectString(final Map<String, List<String>> parameters)
        throws UnsupportedEncodingException {
    String paramString = "";
    Set<String> sortedKeys = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
    sortedKeys.addAll(parameters.keySet());
    sortedKeys.remove(SecurityParameter.Signature.parameter());
    for (final String key : sortedKeys) {
        if (parameters.get(key).isEmpty()) {
            paramString = paramString.concat(key).replaceAll("\\+", " ");
        } else//from   w ww.  j  av  a 2 s . co m
            for (final String value : Ordering.natural().sortedCopy(parameters.get(key))) {
                paramString = paramString.concat(key).concat(Strings.nullToEmpty(value).replaceAll("\\+", " "));
            }
    }
    try {
        return new String(URLCodec.decodeUrl(paramString.getBytes()));
    } catch (DecoderException e) {
        return paramString;
    }
}

From source file:org.kuali.mobility.push.dao.DeviceFeedbackMonitor.java

/**
 * This is a private method that checks Apple's feedback service for devices that need to be removed. 
 * /*from  ww  w.j  av  a2  s.  co m*/
 */
private void checkiOSDeviceFeedback() {
    LOG.info("Checking iOS Device Feedback");
    final int cFEEDBACKTUPLESIZE = 38;
    final int cBLOCKSIZE = 1024;
    final int cBYTEMASK = 0x000000FF;

    //      SSLSocket feedbackSocket = openAppleSocket(feedbackHost, feedbackPort);
    SSLSocket feedbackSocket = null;
    try {
        feedbackSocket = iOSFeedbackConnectionPool.borrowObject();
    } catch (Exception e) {
        LOG.info("Was unable to borrow SSQLSocket from Pool");
    }

    if (null == feedbackSocket) {
        LOG.info("APNS Feedback Socket is NOT connected.");
    } else {
        LOG.info("APNS Feedback Socket is connected. Checking Feedback.");
        try {
            InputStream in = feedbackSocket.getInputStream();

            // Read bytes        
            byte[] b = new byte[cBLOCKSIZE];
            ByteArrayOutputStream message = new ByteArrayOutputStream();
            int nbBytes = 0;
            // socketStream.available can return 0
            // http://forums.sun.com/thread.jspa?threadID=5428561
            while ((nbBytes = in.read(b, 0, cBLOCKSIZE)) != -1) {
                message.write(b, 0, nbBytes);
            }

            byte[] listOfDevices = message.toByteArray();
            int nbDevices = listOfDevices.length / cFEEDBACKTUPLESIZE;
            LOG.info(nbDevices + " devices had feedback.");

            for (int j = 0; j < nbDevices; j++) {
                int offset = j * cFEEDBACKTUPLESIZE;

                // Build date
                int index = 0;
                int firstByte = 0;
                int secondByte = 0;
                int thirdByte = 0;
                int fourthByte = 0;
                long anUnsignedInt = 0;

                firstByte = (cBYTEMASK & ((int) listOfDevices[offset]));
                secondByte = (cBYTEMASK & ((int) listOfDevices[offset + 1]));
                thirdByte = (cBYTEMASK);
                fourthByte = (cBYTEMASK & ((int) listOfDevices[offset + 3]));
                index = index + 4;
                anUnsignedInt = ((long) (firstByte << 24 | secondByte << 16 | thirdByte << 8 | fourthByte))
                        & 0xFFFFFFFFL;
                Timestamp timestamp = new Timestamp(anUnsignedInt * 1000);

                // Build device token length
                int deviceTokenLength = listOfDevices[offset + 4] << 8 | listOfDevices[offset + 5];

                // Build device token
                String deviceToken = "";
                int octet = 0;
                for (int k = 0; k < 32; k++) {
                    octet = (cBYTEMASK & ((int) listOfDevices[offset + 6 + k]));
                    deviceToken = deviceToken.concat(String.format("%02x", octet));
                }

                LOG.info(timestamp);
                LOG.info(deviceToken);
                Device dtoDelete = deviceService.findDeviceByRegId(deviceToken);
                if (deviceService.removeDevice(dtoDelete)) {
                    LOG.info("Deleted " + dtoDelete.getDeviceName());
                }
            }

        } catch (Exception e) {

        } finally {
            try {
                feedbackSocket.close();
            } catch (Exception e) {

            }
        }
    }
}

From source file:fr.natoine.model_annotation.AnnotationStatus.java

private String createCheckbox(String _html, String _className, String _status, String _unique_id, String _value,
        int _cpt) {
    _html = _html.concat(
            "<div class=choice><input type=checkbox name=\"checkbox_" + _className.toLowerCase() + "_" + _status
                    + "_" + _cpt + "_" + _unique_id + "\" value=\"" + _value + "\" /> " + _value + "</div>");
    return _html;
}

From source file:org.addhen.smssync.controllers.MessageResultsController.java

/**
 * This method is handling POST ?task=result message_result
 *
 * @param syncUrl url to web server// w w w .j a v  a 2s  .c  om
 * @param results list of message result data
 */
public void sendMessageResultPOSTRequest(SyncUrl syncUrl, List<MessageResult> results) {
    String newEndPointURL = syncUrl.getUrl().concat(TASK_RESULT_URL_PARAM);

    final String urlSecret = syncUrl.getSecret();

    if (!TextUtils.isEmpty(urlSecret)) {
        String urlSecretEncoded = urlSecret;
        newEndPointURL = newEndPointURL.concat("&secret=");
        try {
            urlSecretEncoded = URLEncoder.encode(urlSecret, "UTF-8");
        } catch (java.io.UnsupportedEncodingException e) {
            mUtil.log(e.getMessage());
        }
        newEndPointURL = newEndPointURL.concat(urlSecretEncoded);
    }

    MainHttpClient client = new MainHttpClient(newEndPointURL, mContext);
    try {

        client.setMethod(HttpMethod.POST);
        client.setStringEntity(createMessageResultJSON(results));
        client.setHeader("Accept", "application/json");
        client.setHeader("Content-type", "application/json");
        client.execute();
    } catch (Exception e) {
        mUtil.log(mContext.getString(R.string.message_processed_failed));
    } finally {
        if (client != null) {
            if (HttpStatus.SC_OK == client.responseCode()) {
                mUtil.log(mContext.getString(R.string.message_processed_success));
            }
        }
    }
}

From source file:es.juntadeandalucia.panelGestion.negocio.utiles.geosearch.GeosearchDataImportWriter.java

private void addEntities() throws XPathExpressionException {
    Node document = getDocumentNode();

    for (GeosearchTableVO geosearchTable : tables) {
        Element entity = generateEntity(geosearchTable, document);
        if (entity != null) {
            /*//from   w w  w.j a  va  2s. co m
             * checks if the entity already exists. In that case, duplicates the
             * entity with other name and adds a comment
             */
            boolean existsEntity = existsEntity(entity);
            if (existsEntity) {
                String entityName = entity.getAttribute("name");
                int numSameEntities = getNumOfSameEntities(entity);
                entityName = entityName.concat("_duplicated_").concat(String.valueOf(numSameEntities));
                entity.setAttribute("name", entityName);
            }
            document.appendChild(entity);
            insertTableNameComment(document, geosearchTable.getTable().getName(), entity);
            if (existsEntity) {
                String comment = "IMPORTANTE: Esta entidad ya se encuentra duplicada en el fichero dataImport."
                        .concat(" Revise la configuracin ya que es posible que exista informacin duplicada");
                insertComment(document, entity, comment);
            }
        }
    }
}

From source file:hydrograph.ui.graph.editor.RenameJobParticipant.java

private void getRenameChanges(final HashMap<IFile, RenameResourceChange> changes, String newName,
        IResource resource) {//from  w  w  w . j av  a2  s  .c  o m
    RenameResourceChange change = (RenameResourceChange) changes.get((IFile) resource);

    if (change == null) {
        String fileName = ResourceChangeUtil.removeExtension(resource.getName());
        if (fileName.endsWith(DEBUG)) {
            newName = newName.concat(DEBUG);
        }
        change = new RenameResourceChange(resource.getFullPath(), newName + "." + resource.getFileExtension());
        changes.put((IFile) resource, change);
    }
}