Example usage for com.liferay.portal.kernel.util PropsKeys COMBO_ALLOWED_FILE_EXTENSIONS

List of usage examples for com.liferay.portal.kernel.util PropsKeys COMBO_ALLOWED_FILE_EXTENSIONS

Introduction

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

Prototype

String COMBO_ALLOWED_FILE_EXTENSIONS

To view the source code for com.liferay.portal.kernel.util PropsKeys COMBO_ALLOWED_FILE_EXTENSIONS.

Click Source Link

Usage

From source file:com.liferay.rtl.servlet.filters.ComboServletFilter.java

License:Open Source License

protected boolean validateModuleExtension(String moduleName) throws Exception {

    boolean validModuleExtension = false;

    String[] fileExtensions = PrefsPropsUtil.getStringArray(PropsKeys.COMBO_ALLOWED_FILE_EXTENSIONS,
            StringPool.COMMA);/*ww  w . ja v  a  2 s  .  com*/

    for (String fileExtension : fileExtensions) {
        if (StringPool.STAR.equals(fileExtension) || StringUtil.endsWith(moduleName, fileExtension)) {

            validModuleExtension = true;

            break;
        }
    }

    return validModuleExtension;
}