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:cc.arduino.plugins.wifi101.flashers.Flasher.java

public File openFirmwareFile() throws Exception {
    try {/*from  ww  w. ja  v  a 2s  .c o  m*/
        String jarPath = Flasher.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
        File jarFolder = new File(jarPath).getParentFile();
        File fwfile = new File(jarFolder, filename);
        return fwfile;
    } catch (URISyntaxException e) {
        String message = "File not found ";
        throw new Exception(message.concat(filename));
    }
}

From source file:jeplus.RadianceConfig.java

/**
 * Get DaySim Bin Directory in absolute form
 * @return // w w  w.j a  va 2 s. c  o m
 */
@JsonIgnore
public String getResolvedDaySimBinDir() {
    String dir = RelativeDirUtil.checkAbsolutePath(DaySimBinDir, UserBaseDir);
    dir = dir.concat(dir.endsWith(File.separator) ? "" : File.separator);
    return dir;
}

From source file:jeplus.RadianceConfig.java

/**
 * Get DaySim Lib Directory in absolute form
 * @return //from   w w  w .  j  ava  2 s. c o m
 */
@JsonIgnore
public String getResolvedDaySimLibDir() {
    String dir = RelativeDirUtil.checkAbsolutePath(DaySimLibDir, UserBaseDir);
    dir = dir.concat(dir.endsWith(File.separator) ? "" : File.separator);
    return dir;
}

From source file:jeplus.RadianceConfig.java

/**
 * Get Radiance Bin Directory in absolute form
 * @return /*from   w  ww .j  a  v a  2  s .  com*/
 */
@JsonIgnore
public String getResolvedRadianceBinDir() {
    String dir = RelativeDirUtil.checkAbsolutePath(RadianceBinDir, UserBaseDir);
    dir = dir.concat(dir.endsWith(File.separator) ? "" : File.separator);
    return dir;
}

From source file:jeplus.RadianceConfig.java

/**
 * Get Radiance Lib Directory in absolute form
 * @return /*from   w w  w  .  ja  va2 s. c o m*/
 */
@JsonIgnore
public String getResolvedRadianceLibDir() {
    String dir = RelativeDirUtil.checkAbsolutePath(RadianceLibDir, UserBaseDir);
    dir = dir.concat(dir.endsWith(File.separator) ? "" : File.separator);
    return dir;
}

From source file:com.erudika.para.security.CachedCsrfTokenRepository.java

/**
 * Loads a CSRF token from cache./*www  .ja  v  a 2  s.  c o m*/
 * @param request HTTP request
 * @return the token
 */
public CsrfToken loadToken(HttpServletRequest request) {
    CsrfToken token = null;
    String ident = getIdentifierFromCookie(request);
    if (ident != null) {
        String key = ident.concat(parameterName);
        if (Config.isCacheEnabled()) {
            token = cache.get(Config.APP_NAME_NS, key);
        } else {
            Object[] arr = localCache.get(key);
            if (arr != null && arr.length == 2) {
                boolean expired = (((Long) arr[1]) + Config.SESSION_TIMEOUT_SEC * 1000) < System
                        .currentTimeMillis();
                if (expired) {
                    localCache.remove(key);
                } else {
                    token = (CsrfToken) arr[0];
                }
            }
        }
    }
    return token;
}

From source file:io.orchestrate.client.KvListResource.java

/**
 * Fetch a paginated, lexicographically ordered list of items contained in a
 * collection./* w  w  w  .  ja v a  2  s . c  o m*/
 *
 * <p>Usage:</p>
 * <pre>
 * {@code
 * KvList<String> objects =
 *         client.listCollection("someCollection")
 *               .limit(10)
 *               .get(String.class)
 *               .get();
 * }
 * </pre>
 *
 * @param clazz Type information for marshalling objects at runtime.
 * @param <T> The type to deserialize the result of the request to.
 * @return The prepared get request.
 */
public <T> OrchestrateRequest<KvList<T>> get(final @NonNull Class<T> clazz) {
    checkArgument(!inclusive || startKey != null, "'inclusive' requires 'startKey' for request.");

    final String uri = client.uri(collection);
    String query = "limit=".concat(Integer.toString(limit));
    query = query.concat("&values=").concat(Boolean.toString(withValues));
    if (startKey != null) {
        final String keyName = (inclusive) ? "startKey" : "afterKey";
        query = query.concat('&' + keyName + '=').concat(client.encode(startKey));
    }

    final HttpContent packet = HttpRequestPacket.builder().method(Method.GET).uri(uri).query(query).build()
            .httpContentBuilder().build();

    return new OrchestrateRequest<KvList<T>>(client, packet, new ResponseConverter<KvList<T>>() {
        @Override
        public KvList<T> from(final HttpContent response) throws IOException {
            final int status = ((HttpResponsePacket) response.getHttpHeader()).getStatus();
            assert (status == 200);

            final JsonNode jsonNode = toJsonNode(response);

            final OrchestrateRequest<KvList<T>> next;
            if (jsonNode.has("next")) {
                final String page = jsonNode.get("next").asText();
                final URI url = URI.create(page);
                final HttpContent packet = HttpRequestPacket.builder().method(Method.GET).uri(uri)
                        .query(url.getQuery()).build().httpContentBuilder().build();
                next = new OrchestrateRequest<KvList<T>>(client, packet, this, false);
            } else {
                next = null;
            }
            final int count = jsonNode.get("count").asInt();
            final List<KvObject<T>> results = new ArrayList<KvObject<T>>(count);

            final Iterator<JsonNode> iter = jsonNode.get("results").elements();
            while (iter.hasNext()) {
                results.add(toKvObject(iter.next(), clazz));
            }

            return new KvList<T>(results, count, next);
        }
    });
}

From source file:jeplus.INSELConfig.java

/**
 * Get Bin Directory//from w  ww . ja  v  a 2 s.  co  m
 */
@JsonIgnore
public String getResolvedInselBinDir() {
    String dir = RelativeDirUtil.checkAbsolutePath(InselBinDir, UserBaseDir);
    dir = dir.concat(dir.endsWith(File.separator) ? "" : File.separator);
    return dir;
}

From source file:org.jasig.portlet.emailpreview.service.auth.DemoAuthenticationService.java

public String getMailAccountName(PortletRequest request, MailStoreConfiguration config) {

    @SuppressWarnings("unchecked")
    Map<String, String> userInfo = (Map<String, String>) request.getAttribute(PortletRequest.USER_INFO);
    String rslt = userInfo.get(USERNAME_ATTRIBUTE);
    String usernameSuffix = config.getUsernameSuffix();
    if (rslt != null && !StringUtils.isBlank(usernameSuffix)) {
        rslt = rslt.concat(usernameSuffix);
    }/*from w  w w  .j  av a2  s  . com*/
    return rslt;

}

From source file:com.liferay.portal.template.velocity.internal.LiferayResourceManager.java

public LiferayResourceManager() {
    String portalCacheName = TemplateResource.class.getName();

    portalCacheName = portalCacheName.concat(StringPool.POUND).concat(TemplateConstants.LANG_TYPE_VM);

    _portalCache = SingleVMPoolUtil.getPortalCache(portalCacheName);
}