List of usage examples for java.lang String concat
public String concat(String str)
From source file:com.interacciones.mxcashmarketdata.driver.process.impl.FileMessageProcessing.java
@Override public void receive(String message, long sequence) { try {/* w w w . ja v a 2 s . c o m*/ bf.write(message.concat("-".concat(formato.format(new Date())))); bf.write(13); bf.write(10); bf.flush(); } catch (IOException e) { e.printStackTrace(); } }
From source file:com.peertopark.spring.commons.UriBuilder.java
public UriBuilder appendPath(String path) { String currentPath = super.getPath(); String updatedPath = currentPath.concat(path); return (UriBuilder) super.setPath(updatedPath); }
From source file:es.juntadeandalucia.panelGestion.presentacion.controlador.impl.MapeaController.java
public String getUrlForWMSLayer(String name, String wmsUrl, boolean transparence) { String urlWMSLayer = PanelSettings.mapeaUrl; urlWMSLayer = urlWMSLayer.concat("&layers=").concat("WMS*").concat(name).concat("*").concat(wmsUrl) .concat("*").concat(name).concat("*").concat(String.valueOf(transparence)); return urlWMSLayer; }
From source file:edu.harvard.iq.dataverse.ingest.tabulardata.impl.plugins.rdata.RDATAFileReader.java
/** * Read a Local Resource and Return Its Contents as a String * <code>readLocalResource</code> searches the local path around the class * <code>RDATAFileReader</code> for a file and returns its contents as a * string./* w ww .j av a 2 s . c om*/ * @param path String specifying the name of the local file to be converted * into a UTF-8 string. * @return a UTF-8 <code>String</code> */ private static String readLocalResource(String path) { // Debug LOG.fine(String.format("RDATAFileReader: readLocalResource: reading local path \"%s\"", path)); // Get stream InputStream resourceStream = RDATAFileReader.class.getResourceAsStream(path); String resourceAsString = ""; // Try opening a buffered reader stream try { BufferedReader rd = new BufferedReader(new InputStreamReader(resourceStream, "UTF-8")); String line = null; while ((line = rd.readLine()) != null) { resourceAsString = resourceAsString.concat(line + "\n"); } resourceStream.close(); } catch (IOException ex) { LOG.warning(String.format( "RDATAFileReader: (readLocalResource) resource stream from path \"%s\" was invalid", path)); } // Return string return resourceAsString; }
From source file:es.juntadeandalucia.panelGestion.presentacion.controlador.impl.MapeaController.java
/** * TODO//w w w .j a v a2 s . co m * * @param serviceUrl * @return */ public String getUrlForGeosearch(String serviceUrl) { String mapeaGeosearchUrl = PanelSettings.mapeaUrl; mapeaGeosearchUrl = mapeaGeosearchUrl.concat("&geosearch=").concat(serviceUrl); return mapeaGeosearchUrl; }
From source file:fr.univrouen.poste.services.ZipService.java
public void writeZip(List<PosteCandidature> posteCandidatures, OutputStream destStream) throws IOException, SQLException { ZipOutputStream out = new ZipOutputStream(destStream); for (PosteCandidature posteCandidature : posteCandidatures) { String folderName = posteCandidature.getPoste().getNumEmploi().concat("/"); folderName = folderName.concat(posteCandidature.getCandidat().getNom().concat("-")); folderName = folderName.concat(posteCandidature.getCandidat().getPrenom().concat("-")); folderName = folderName.concat(posteCandidature.getCandidat().getNumCandidat().concat("/")); for (PosteCandidatureFile posteCandidatureFile : posteCandidature.getCandidatureFiles()) { String fileName = posteCandidatureFile.getId().toString().concat("-") .concat(posteCandidatureFile.getFilename()); String folderFileName = folderName.concat(fileName); out.putNextEntry(new ZipEntry(folderFileName)); InputStream inputStream = posteCandidatureFile.getBigFile().getBinaryFile().getBinaryStream(); BufferedInputStream bufInputStream = new BufferedInputStream(inputStream, BUFFER); byte[] bytes = new byte[BUFFER]; int length; while ((length = bufInputStream.read(bytes)) >= 0) { out.write(bytes, 0, length); }/* w ww .j av a 2s. c o m*/ out.closeEntry(); } } out.close(); }
From source file:com.haulmont.cuba.portal.config.SiteSettings.java
/** * Basically this method prepends webapp's prefix to the path * * @param path path relative to the root of webapp * @return Full relative path on server/*from w w w .j a va 2 s .c o m*/ */ public String composeFullRelativePath(String path) { Configuration configuration = AppBeans.get(Configuration.NAME); GlobalConfig globalConfig = configuration.getConfig(GlobalConfig.class); String webAppPrefix = "/".concat(globalConfig.getWebContextName().intern()); return path.startsWith("/") ? webAppPrefix.concat(path) : webAppPrefix.concat("/").concat(path); }
From source file:eu.morfeoproject.fast.catalogue.services.GenericServlet.java
protected void redirectToFormat(HttpServletRequest request, HttpServletResponse response, String format) throws IOException { String extension = MediaType.getExtension(format); extension = extension == null ? MediaType.getExtension(MediaType.APPLICATION_JSON) : extension; String url = request.getRequestURL().toString(); url = (url.charAt(url.length() - 1) == '/') ? url.concat(extension) : url.concat("/" + extension); response.sendRedirect(url);//from w w w .j av a2s .c o m }
From source file:org.n52.sos.soe.GetCacheMetadataTest.java
@Test public void validateGetCacheMetadata() throws ClientProtocolException, IllegalStateException, IOException, XmlException { String url = HttpUtil.resolveServiceURL(); JsonNode json = HttpUtil.executeGetAndParseAsJson( url.concat("GetCacheMetadata?service=SOS&version=2.0.0&request=GetCacheMetadata&f=json")); logger.info(json.toString());//from w w w . ja v a2 s . c o m JsonNode pum = json.get("PropertyUnitMappingCache"); Assert.assertTrue("PropertyUnitMappingCache too old", validateLatestExecution(pum, url)); JsonNode oo = json.get("ObservationOfferingCache"); Assert.assertTrue("ObservationOfferingCache too old", validateLatestExecution(oo, url)); Assert.assertTrue("coult not find updateCacheOnStartup!", json.has("updateCacheOnStartup")); }
From source file:de.interseroh.report.auth.UserServiceBeanIT.java
@Transactional @Test//from w w w. ja v a2 s . c o m public void testFindUserRolesByUserEmail() { // We need to make this transactional so we can rollback at the end // Prepare createUserRolesAndReports(); // CUT String email = "lofi@dewanto.com"; Collection<UserRole> userRoles = userService.findUserRolesByUserEmail(email); // Asserts assertEquals(userRoles.size(), 2); String result = ""; for (UserRole userRole : userRoles) { result = result.concat(userRole.getRole().getName()); } assertEquals(true, result.contains("USER_INTERSEROH")); assertEquals(true, result.contains("USER_CROWDCODE")); }