List of usage examples for java.lang String concat
public String concat(String str)
From source file:be.iminds.aiolos.ui.CommonServlet.java
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Not necessary for plugin only as standalone app. // doGetPlugin allways needed. // check whether we are not at .../{webManagerRoot} final String pathInfo = request.getPathInfo(); if (pathInfo == null || pathInfo.equals("/")) { String path = request.getRequestURI(); if (!path.endsWith("/")) { path = path.concat("/"); }// w ww . j a v a 2 s . com path = path.concat(LABEL); response.sendRedirect(path); return; } int slash = pathInfo.indexOf("/", 1); if (slash < 2) { slash = pathInfo.length(); } final String label = pathInfo.substring(1, slash); if (label != null && label.startsWith(LABEL)) { final RequestInfo reqInfo = new RequestInfo(request, LABEL); if (reqInfo.extension.equals("html")) { doGetPlugin(request, response); } else if (reqInfo.extension.equals("json")) { renderJSON(response, request.getLocale()); } } else { response.sendError(HttpServletResponse.SC_NOT_FOUND); } }
From source file:gmc.gestaxi.controller.UserServiceImpl.java
@Override public User createUser(User user, String password, String activationByEmailContextUri) throws Exception { user = registerUser(user, password, activationByEmailContextUri); String activationUrl = activationByEmailContextUri.concat("/") .concat(user.getUsername().concat("/eouihe3tuh34.onocewoweuuo.raadf67npgigpreigpn==").concat("/") .concat(user.getActivateUser().getActivationCode())); emailUtility.sendEmail("New User created", "Click here to activate your account:".concat(activationUrl), "himanshubhardwajin@gmail.com"); return user;/*from www. j a v a 2 s .c om*/ }
From source file:es.juntadeandalucia.panelGestion.presentacion.controlador.impl.MapeaController.java
public String getUrlForWFSLayer(String name, String workspace, String geometryType, Geoserver geoserver) { String urlWFSLayer = PanelSettings.mapeaUrl; String geometryTypeLayer = geometryType; if (!StringUtils.isEmpty(geometryTypeLayer)) { geometryTypeLayer = geometryTypeLayer.replace("MULTI", "M"); }//from ww w . ja v a2s.com urlWFSLayer = urlWFSLayer.concat("&layers=").concat("WFST*").concat(name).concat("*") .concat(geoserver.getWFSUrl(workspace)).concat("*").concat(workspace).concat(":").concat(name) .concat("*").concat(geometryTypeLayer); return urlWFSLayer; }
From source file:be.bittich.dynaorm.dialect.MySQLDialect.java
@Override public String equalTo(String request, String label) throws RequestInvalidException { if (label == null || isEmpty(label)) { throw new RequestInvalidException("Label or Value for the request is empty or null"); }/*from w w w . jav a2s. c om*/ return request.concat(label).concat(" ").concat(EQUALITY).concat(REPLACEMENT_VALUE); }
From source file:it.greenvulcano.configuration.BaseConfigurationManager.java
private Path getConfigurationPath(String name) { return getHistoryPath().resolve(name.concat(".zip")); }
From source file:com.github.maven.plugin.client.impl.GithubClientImpl.java
/** * Returns the repositoryUrl download url for the given repositoryUrl * url./* w w w . j a v a 2 s .co m*/ * * @param repositoryUrl The repository url. * * @return The download url for the given repositoryUrl url. * * @throws NullPointerException If the parameter repositoryUrl is {@code null}. */ private String toRepositoryDownloadUrl(String repositoryUrl) { return repositoryUrl.concat(repositoryUrl.endsWith("/") ? "downloads" : "/downloads"); }
From source file:de.mpg.escidoc.pubman.util.CommonUtils.java
/** * Limits a string to the given length (on word basis). * @param string the string to be limited * @param length the maximum length of the string * @return the limited String//w ww.j av a2 s. c om */ public static String limitString(final String string, final int length) { String limitedString = new String(); String[] splittedString = string.split(" "); if (splittedString != null && splittedString.length > 0) { limitedString = splittedString[0]; for (int i = 1; i < splittedString.length; i++) { String newLimitedString = limitedString + " " + splittedString[i]; if (newLimitedString.length() <= length) { limitedString = newLimitedString; } else { return limitedString.concat("..."); } } } return limitedString; }
From source file:br.usp.poli.lta.cereda.macro.ui.Editor.java
/** * Construtor./*from w w w .j a v a2 s . c o m*/ */ public Editor() { // define as configuraes de exibio super("Expansor de macros"); setPreferredSize(new Dimension(550, 550)); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setResizable(false); setLayout(new MigLayout()); // cria os botes e suas respectivas aes open = new JButton("Abrir", new ImageIcon(getClass().getResource("/br/usp/poli/lta/cereda/macro/images/open.png"))); save = new JButton("Salvar", new ImageIcon(getClass().getResource("/br/usp/poli/lta/cereda/macro/images/save.png"))); run = new JButton("Executar", new ImageIcon(getClass().getResource("/br/usp/poli/lta/cereda/macro/images/play.png"))); clear = new JButton("Limpar", new ImageIcon(getClass().getResource("/br/usp/poli/lta/cereda/macro/images/clear.png"))); // cria uma janela de dilogo para abrir e salvar arquivos de texto chooser = new JFileChooser(); chooser.setMultiSelectionEnabled(false); FileNameExtensionFilter filter = new FileNameExtensionFilter("Arquivos de texto", "txt", "text"); chooser.setFileFilter(filter); // ao de abertura de arquivo open.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { int value = chooser.showOpenDialog(Editor.this); if (value == JFileChooser.APPROVE_OPTION) { File file = chooser.getSelectedFile(); try { String content = FileUtils.readFileToString(file); input.setText(content); output.setText(""); } catch (Exception e) { } } } }); // ao de salvamento de arquivo save.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { int value = chooser.showSaveDialog(Editor.this); if (value == JFileChooser.APPROVE_OPTION) { File file = chooser.getSelectedFile(); try { FileUtils.writeStringToFile(file, input.getText(), Charset.forName("UTF-8")); output.setText(""); } catch (Exception e) { } } } }); // ao de limpeza da janela de sada clear.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { output.setText(""); } }); // ao de execuo do expansor de macros run.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { try { output.setText(MacroExpander.parse(input.getText())); } catch (Exception exception) { String out = StringUtils.rightPad("ERRO: ", 50, "-").concat("\n"); out = out.concat(WordUtils.wrap(exception.getMessage(), 50)).concat("\n"); out = out.concat(StringUtils.repeat(".", 50)).concat("\n"); output.setText(out); } } }); // tela de entrada do texto input = new RSyntaxTextArea(14, 60); input.setCodeFoldingEnabled(true); input.setWrapStyleWord(true); input.setLineWrap(true); RTextScrollPane iinput = new RTextScrollPane(input); add(iinput, "span 4, wrap"); // adiciona os botes add(open); add(save); add(run); add(clear, "wrap"); // tela de sada da expanso output = new RSyntaxTextArea(14, 60); output.setEditable(false); output.setCodeFoldingEnabled(true); output.setWrapStyleWord(true); output.setLineWrap(true); RTextScrollPane ioutput = new RTextScrollPane(output); add(ioutput, "span 4"); // ajustes finais pack(); setLocationRelativeTo(null); }
From source file:fr.univrouen.poste.domain.User.java
public String getStatus() { String status = ""; if (this.getIsAdmin()) status = status.concat("admin, "); if (this.getIsSuperManager()) status = status.concat("super-manager, "); if (this.getIsManager()) status = status.concat("manager, "); if (this.getIsMembre()) status = status.concat("membre, "); if (this.getIsCandidat()) status = status.concat("candidat, "); return status; }
From source file:com.krawler.esp.utils.PropsLoader.java
public static Properties loadProperties(String name, ClassLoader loader) { if (name == null) throw new IllegalArgumentException("null input: name"); if (name.startsWith("/")) name = name.substring(1);//from w w w . ja v a 2 s . co m if (name.endsWith(SUFFIX)) name = name.substring(0, name.length() - SUFFIX.length()); Properties result = null; InputStream in = null; try { if (loader == null) loader = ClassLoader.getSystemClassLoader(); if (LOAD_AS_RESOURCE_BUNDLE) { name = name.replace('/', '.'); // Throws MissingResourceException on lookup failures: final ResourceBundle rb = ResourceBundle.getBundle(name, Locale.getDefault(), loader); result = new Properties(); for (Enumeration keys = rb.getKeys(); keys.hasMoreElements();) { final String key = (String) keys.nextElement(); final String value = rb.getString(key); result.put(key, value); } } else { name = name.replace('.', '/'); if (!name.endsWith(SUFFIX)) name = name.concat(SUFFIX); // Returns null on lookup failures: in = loader.getResourceAsStream(name); if (in != null) { result = new Properties(); result.load(in); // Can throw IOException } } } catch (Exception e) { logger.warn(e.getMessage(), e); result = null; } finally { if (in != null) try { in.close(); } catch (Throwable ignore) { logger.warn(ignore.getMessage(), ignore); } } if (THROW_ON_LOAD_FAILURE && (result == null)) { throw new IllegalArgumentException("could not load [" + name + "]" + " as " + (LOAD_AS_RESOURCE_BUNDLE ? "a resource bundle" : "a classloader resource")); } return result; }