Example usage for org.apache.commons.text StringTokenizer getTokenList

List of usage examples for org.apache.commons.text StringTokenizer getTokenList

Introduction

In this page you can find the example usage for org.apache.commons.text StringTokenizer getTokenList.

Prototype

public List<String> getTokenList() 

Source Link

Document

Gets a copy of the full token list as an independent modifiable list.

Usage

From source file:org.silverpeas.core.silverstatistics.volume.service.SilverStatisticsService.java

/**
 * @param type the statistic type (Access, Size, Volume, Connexion)
 * @param data the value to put in statistic
 *//* w  ww. ja  va2s.  c  o m*/
@Override
public void putStats(StatType type, String data) {
    StringTokenizer stData = new StringTokenizer(data, SEPARATOR);
    List<String> dataArray = stData.getTokenList();
    if (myStatsConfig.isGoodDatas(type, dataArray)) {
        try (Connection myCon = DBUtil.openConnection()) {

            SilverStatisticsDAO.putDataStats(myCon, type, dataArray, myStatsConfig);
            if (!myCon.getAutoCommit()) {
                myCon.commit();
            }
        } catch (SQLException | StatisticsRuntimeException e) {
            SilverLogger.getLogger(this).error("typeOfStats={0}, dataArray={1}",
                    new Object[] { type, dataArray }, e);
        }
    } else {
        SilverLogger.getLogger(this).error("input data={0} for {1}", data, type);
    }
}