Example usage for org.apache.commons.lang StringUtils EMPTY

List of usage examples for org.apache.commons.lang StringUtils EMPTY

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils EMPTY.

Prototype

String EMPTY

To view the source code for org.apache.commons.lang StringUtils EMPTY.

Click Source Link

Document

The empty String "".

Usage

From source file:lince.LinceApp.java

/**
 * @param args the command line arguments
 *///from ww  w. j av  a  2  s.c  om
public static void main(final String[] args) {
    String vlcPath = StringUtils.EMPTY;
    try {
        if (RuntimeUtil.isWindows()) {
            vlcPath = WindowsRuntimeUtil.getVlcInstallDir();
            /*if (StringUtils.isEmpty(vlcPath)){
                vlcPath= "C:\\Program Files (x86)\\VideoLAN";
            }*/
            System.setProperty("jna.library.path", vlcPath);
            setI18n();
        }
        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                LinceFrame.getInstance();
            }
        });
    } catch (Exception e) {
        logger.log(Level.SEVERE, "Error inicializando main. vlcPath@" + vlcPath, e);
    }
}

From source file:com.mmj.app.common.core.lang.Argument.java

/**
 * ???/*w ww. j  ava  2  s.  c o m*/
 * 
 * @param s
 * @return
 */
public static boolean isEmpty(String s) {
    if (null == s || StringUtils.EMPTY.equals(s) || StringUtils.EMPTY.equals(s.trim())
            || "null".equalsIgnoreCase(s)) {
        return true;
    } else {
        return false;
    }
}

From source file:com.mmj.app.web.tools.PicTools.java

/**
 * ??// w ww.ja v  a2 s  .  co  m
 * 
 * @param url
 * @param picSize
 * @return
 */
public static String processURL(String url, String suffix) {
    if (StringUtils.isEmpty(url)) {
        return StringUtils.EMPTY;
    }
    if (StringUtils.isEmpty(suffix)) {
        return url;
    }
    String pefix = url;
    if (StringUtils.contains(url, "=")) {
        pefix = StringUtils.substringBeforeLast(url, "=");
    } else if (StringUtils.contains(url, "=C")) {
        pefix = StringUtils.substringBeforeLast(url, "=C");
    } else {
        pefix = StringUtils.substringBeforeLast(url, DOT);
    }
    String dotStr = StringUtils.substringAfterLast(url, DOT);
    return pefix + suffix + DOT + dotStr;
}

From source file:com.amalto.core.storage.hibernate.ListBridge.java

private static String getValueFromObject(List object) {
    if (object == null) {
        return StringUtils.EMPTY;
    }//from w  w  w  .j  a  va  2 s  . c  o  m
    Iterator valuesIterator = object.iterator();
    StringBuilder builder = new StringBuilder();
    while (valuesIterator.hasNext()) {
        builder.append(String.valueOf(valuesIterator.next()));
        if (valuesIterator.hasNext()) {
            builder.append(' ');
        }
    }
    return builder.toString();
}

From source file:com.photon.phresco.commons.CIPasswordScrambler.java

public static String mask(String password) throws PhrescoException {
    if (StringUtils.isEmpty(password)) {
        return StringUtils.EMPTY;
    }/*  w w w . j  a v a2 s  .  c o m*/

    try {
        return new String(Base64.encode(password.getBytes("UTF-8")));
    } catch (UnsupportedEncodingException e) {
        throw new PhrescoException(e);
    }
}

From source file:com.greenline.hrs.admin.util.db.SchemaExport.java

public static String exportMySQL(Class type) {
    if (type == null) {
        return StringUtils.EMPTY;
    }/*from www. j av  a  2 s. co m*/
    String tableName = type.getName().substring(type.getName().lastIndexOf('.') + 1);
    tableName = StringUtil.underscoreName(tableName);
    StringBuilder sb = new StringBuilder();
    sb.append("DROP TABLE IF EXISTS `" + tableName + "`;" + LINUX_LINE_DELIMITER);
    sb.append("CREATE TABLE `");
    sb.append(tableName);
    sb.append("` (" + LINUX_LINE_DELIMITER + LINUX_LINE_DELIMITER);
    sb.append("`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '',");
    Field[] fields = type.getDeclaredFields();
    for (Field field : fields) {
        if (!Modifier.isStatic(field.getModifiers())) {
            sb.append("`" + StringUtil.underscoreName(field.getName()) + "` "
                    + JdbcColumnUtil.getColumeTypeDesc(field.getType()) + " NOT NULL COMMENT '',"
                    + LINUX_LINE_DELIMITER);
        }
    }
    sb.append("PRIMARY KEY (`id`)" + LINUX_LINE_DELIMITER);
    sb.append(") ENGINE=InnoDB DEFAULT CHARSET=utf8;");
    return sb.toString();
}

From source file:com.cyclopsgroup.tornado.utils.ConfigurationUtils.java

/**
 * Get properties from given configuration node
 *
 * @param root Configuration node root//from  w  ww. j  a  v a 2  s .  c o  m
 * @return Properties object
 * @throws ConfigurationException Illegal format of configuration
 */
public static Properties getProperties(Configuration root) throws ConfigurationException {
    Properties p = new Properties();
    Configuration[] confs = root.getChildren("property");
    for (int i = 0; i < confs.length; i++) {
        Configuration conf = confs[i];
        String name = conf.getAttribute("name");
        String value = conf.getValue(StringUtils.EMPTY);
        if (StringUtils.isNotEmpty(name)) {
            p.setProperty(name, value);
        }
    }
    return p;
}

From source file:me.smoe.adar.analyzer.luence.AnalyzerToy.java

public static void analyzerByStop(String sentence) throws Exception {
    Analyzer analyzer = new StopAnalyzer();

    TokenStream tokenStream = analyzer.tokenStream(StringUtils.EMPTY, new StringReader(sentence));
    tokenStream.addAttribute(CharTermAttribute.class);
    tokenStream.reset();//from  www .  j a  va 2s  .  c o  m
    while (tokenStream.incrementToken()) {
        CharTermAttribute charTermAttribute = (CharTermAttribute) tokenStream
                .getAttribute(CharTermAttribute.class);
        System.out.print(charTermAttribute.toString() + " ,");
    }

    analyzer.close();
}

From source file:com.apexxs.neonblack.utilities.MD5Utilities.java

public static String getMD5Hash(String s) {
    String md5Hash = StringUtils.EMPTY;
    try {//from ww  w.jav a 2  s .com
        MessageDigest md = MessageDigest.getInstance("MD5");
        md.reset();
        byte[] bytes = md.digest(s.getBytes("UTF-8"));
        md5Hash = String.format("%032x", new BigInteger(1, bytes));
    } catch (Exception ex) {
        logger.error("Error generating MD5 hash from " + s + "\n" + ex.getMessage());
    }
    return md5Hash;
}

From source file:com.baifendian.swordfish.common.utils.CommonUtil.java

/**
 * ???//from w ww . j  a va2s  . co m
 */
public static String fileSuffix(String filename) {
    if (StringUtils.isEmpty(filename)) {
        return StringUtils.EMPTY;
    }

    int index = filename.lastIndexOf(".");
    if (index < 0) {
        return StringUtils.EMPTY;
    }

    return filename.substring(index + 1);
}