Example usage for com.liferay.portal.kernel.util StringUtil indexOfAny

List of usage examples for com.liferay.portal.kernel.util StringUtil indexOfAny

Introduction

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

Prototype

public static int indexOfAny(String s, String[] texts, int fromIndex) 

Source Link

Document

Returns the index within the string of the first occurrence of any string from the array, starting the search at the specified index within the string.

Usage

From source file:com.liferay.exportimport.content.processor.base.BaseTextExportImportContentProcessor.java

License:Open Source License

protected void deleteTimestampParameters(StringBuilder sb, int beginPos) {
    beginPos = sb.indexOf(StringPool.CLOSE_BRACKET, beginPos);

    if ((beginPos == -1) || (beginPos == (sb.length() - 1)) || (sb.charAt(beginPos + 1) != CharPool.QUESTION)) {

        return;//from w w  w .  j  av  a2s  .c  o  m
    }

    int endPos = StringUtil.indexOfAny(sb.toString(), DL_REFERENCE_LEGACY_STOP_CHARS, beginPos + 2);

    if (endPos == -1) {
        return;
    }

    String urlParams = sb.substring(beginPos + 1, endPos);

    urlParams = HttpUtil.removeParameter(urlParams, "t");

    sb.replace(beginPos + 1, endPos, urlParams);
}

From source file:com.liferay.exportimport.internal.content.processor.DLReferencesExportImportContentProcessor.java

License:Open Source License

protected void deleteTimestampParameters(StringBuilder sb, int beginPos) {
    beginPos = sb.indexOf(StringPool.CLOSE_BRACKET, beginPos);

    if ((beginPos == -1) || (beginPos == (sb.length() - 1)) || (sb.charAt(beginPos + 1) != CharPool.QUESTION)) {

        return;/*from w  ww  .j  av a2  s .c  o m*/
    }

    int endPos = StringUtil.indexOfAny(sb.toString(), _DL_REFERENCE_LEGACY_STOP_CHARS, beginPos + 2);

    if (endPos == -1) {
        return;
    }

    String urlParams = sb.substring(beginPos + 1, endPos);

    urlParams = _http.removeParameter(urlParams, "t");

    sb.replace(beginPos + 1, endPos, urlParams);
}