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

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

Introduction

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

Prototype

public static String removeSubstring(String s, String oldSub) 

Source Link

Usage

From source file:com.liferay.item.selector.web.internal.ItemSelectorImpl.java

License:Open Source License

@Override
public List<ItemSelectorCriterion> getItemSelectorCriteria(String itemSelectorURL) {

    Map<String, String[]> parameters = _http.getParameterMap(itemSelectorURL);

    Map<String, String[]> itemSelectorURLParameterMap = new HashMap<>();

    String namespace = _portal.getPortletNamespace(ItemSelectorPortletKeys.ITEM_SELECTOR);

    for (Map.Entry<String, String[]> entry : parameters.entrySet()) {
        String parameterName = entry.getKey();

        if (parameterName.contains(namespace)) {
            String key = StringUtil.removeSubstring(parameterName, namespace);

            itemSelectorURLParameterMap.put(key, entry.getValue());
        }//from  ww  w . j ava  2  s.co  m
    }

    return getItemSelectorCriteria(itemSelectorURLParameterMap);
}

From source file:com.liferay.users.admin.indexer.test.UserIndexerTest.java

License:Open Source License

@Test
public void testEmailAddressPrefix() throws Exception {
    _expectedUser = UserTestUtil.addUser();

    String expectedEmailAddress = _expectedUser.getEmailAddress();

    User actualUser = assertSearchOneUser(StringUtil.removeSubstring(expectedEmailAddress, "@liferay.com"),
            _expectedUser);// w w  w. j av  a  2 s  . co m

    Assert.assertEquals(expectedEmailAddress, actualUser.getEmailAddress());
}