List of usage examples for java.lang String contains
public boolean contains(CharSequence s)
From source file:com.obidea.semantika.database.connection.ConnectionProviderFactory.java
public static Properties getConnectionProperties(PropertiesConfiguration properties) { Properties toReturn = new Properties(); Iterator<String> iter = properties.getKeys(); while (iter.hasNext()) { String propKey = iter.next(); if (propKey.contains(Environment.CONNECTION_PREFIX)) { toReturn.setProperty(propKey, properties.getString(propKey)); }/*from w w w . j a v a 2 s .co m*/ } return toReturn; }
From source file:Main.java
public static String getDealId(String dealUrl) { String baseUrl = "dealId="; String dealId = ""; if (dealUrl.contains(baseUrl)) { dealId = dealUrl.split(baseUrl)[1].trim(); }/*from w w w.j av a 2s . c om*/ return dealId; }
From source file:Main.java
/** * * replaces in text all <action="actionId"> with correspondent shortcut. *///from ww w. j a v a2 s . c om public static String replacement(String text) { String result = text; final String TAG = "action"; while (result.contains("<" + TAG + "=\"")) { int start = result.indexOf("<" + TAG + "=\""); int end = result.indexOf("\">", start); String value = result.substring((start + 3 + TAG.length()), end); String replaceString = "ACTION"; result = result.substring(0, start) + replaceString + result.substring(end + 2); } return result; }
From source file:com.bradmcevoy.http.FileItemWrapper.java
/** * strip path information provided by IE * /*from w w w . ja va 2s. co m*/ * @param s * @return */ public static String fixIEFileName(String s) { if (s.contains("\\")) { int pos = s.lastIndexOf('\\'); s = s.substring(pos + 1); } return s; }
From source file:de.thischwa.pmcms.tool.connection.UploadTreeNode.java
protected static String[] splitPath(String path) { if (!path.contains("" + UploadTree.PATH_SEPARATOR) || StringUtils.isEmpty(path)) return null; String[] keys = new String[2]; keys[0] = path.substring(0, path.indexOf(UploadTree.PATH_SEPARATOR)); keys[1] = path.substring(path.indexOf(UploadTree.PATH_SEPARATOR) + 1, path.length()); return keys;/*from w w w . j a va 2 s.c o m*/ }
From source file:mongodb.MongoUtils.java
public static void construct(Document doc, String attribut, Object valeur) { if (!attribut.contains(".")) { doc.append(attribut, valeur);// ww w .j a v a 2s. com } else { String[] parties = attribut.split("\\."); if (doc.get(parties[0]) == null) doc.append(parties[0], new Document()); construct((Document) doc.get(parties[0]), StringUtils.join(Arrays.copyOfRange(parties, 1, parties.length), "."), valeur); } }
From source file:Main.java
public static List<String> getCatgFolderContent(String folderDir, String catg) { List<String> allFiles = new ArrayList<>(); List<String> catgFiles = new ArrayList<>(); allFiles = getFolderContent(folderDir); for (String str : allFiles) { if (!TextUtils.isEmpty(str) && str.contains(catg)) catgFiles.add(str);/*from w w w . j a va 2s . c om*/ } return catgFiles; }
From source file:Main.java
public static String prettyFormat(String xml) { if (xml == null || xml.isEmpty() || !xml.contains("<")) { // System.out.println("Why?"+xml.startsWith("<", 0)); return xml; }/*from w w w.j a v a 2 s.co m*/ try { Transformer serializer = SAXTransformerFactory.newInstance().newTransformer(); serializer.setOutputProperty(OutputKeys.INDENT, "yes"); //serializer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); serializer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); Source xmlSource = new SAXSource(new InputSource(new ByteArrayInputStream(xml.getBytes()))); StreamResult res = new StreamResult(new ByteArrayOutputStream()); serializer.transform(xmlSource, res); return new String(((ByteArrayOutputStream) res.getOutputStream()).toByteArray()).replace("><", ">\n<"); } catch (Exception e) { System.out.println("prettyFormat: Error.." + e.getMessage()); //TODO log error return xml.replace("<", "\n<"); // return xml.replace("><", ">\n<"); } }
From source file:evaluation.loadGenerator.randomVariable.RandomVariable.java
public static boolean isRandomVariable(String signature) { return signature.contains("[RAND_VAR:"); }
From source file:org.icgc.dcc.release.client.config.SparkConfig.java
private static boolean isExpoded(String path) { return path.contains("classes"); }