Example usage for com.liferay.portal.kernel.util StringPool MINUS

List of usage examples for com.liferay.portal.kernel.util StringPool MINUS

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util StringPool MINUS.

Prototype

String MINUS

To view the source code for com.liferay.portal.kernel.util StringPool MINUS.

Click Source Link

Usage

From source file:com.evozon.evoportal.my_account.validator.UserAccountValidation.java

private boolean verifyJobTitle(ActionRequest actionRequest) {
    boolean isValid = true;

    String jobTitle = ParamUtil.getString(actionRequest, "jobTitle", StringPool.BLANK);
    jobTitle = jobTitle.replace(StringPool.PERIOD, StringPool.BLANK).replace(StringPool.MINUS,
            StringPool.BLANK);/* w w w. ja  v a2s  . c  o m*/

    if (isInputLengthValid(jobTitle)) {
        SessionErrors.add(actionRequest, "job-title-invalid-length-error");
        isValid = false;
    }

    if (!isAlphaSpaceStringInput(jobTitle)) {
        SessionErrors.add(actionRequest, "job-title-invalid-characters-error");
        isValid = false;
    }

    return isValid;
}

From source file:com.liferay.content.targeting.benchmark.tools.CTSampleSQLBuilder.java

License:Open Source License

protected void buildPluginSqls(String dbType, String sqlDir, File outputDir) throws Exception {

    DB db = DBFactoryUtil.getDB(dbType);

    File dir = new File(sqlDir);

    for (File sqlFile : dir.listFiles()) {
        String sqlFileName = sqlFile.getName();

        if (!sqlFileName.endsWith(_SQL_FILE_SUFFIX)) {
            continue;
        }/*from w ww  . j av  a 2 s.  com*/

        StringBundler sb = new StringBundler(4);

        int index = sqlFileName.indexOf(_SQL_FILE_SUFFIX);

        sb.append(sqlFileName.substring(0, index));
        sb.append(StringPool.MINUS);
        sb.append(dbType);
        sb.append(_SQL_FILE_SUFFIX);

        File newSqlFile = new File(outputDir, sb.toString());

        String line = null;
        Writer writer = null;
        UnsyncBufferedReader unsyncBufferedReader = null;

        try {
            writer = new FileWriter(newSqlFile);

            Reader reader = new FileReader(sqlFile);

            unsyncBufferedReader = new UnsyncBufferedReader(reader);

            while ((line = unsyncBufferedReader.readLine()) != null) {
                line = line.trim();

                if (line.length() == 0) {
                    continue;
                }

                line = db.buildSQL(line);

                writer.write(line);
            }
        } finally {
            if (unsyncBufferedReader != null) {
                unsyncBufferedReader.close();
            }

            if (writer != null) {
                writer.close();
            }
        }
    }
}

From source file:com.liferay.wsrp.service.impl.WSRPProducerLocalServiceImpl.java

License:Open Source License

protected String getGroupName(String name) {
    return _WSRP_GROUP_NAME + StringPool.MINUS + name;
}