001
014
015 package com.liferay.portal.util;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.security.pacl.DoPrivileged;
020 import com.liferay.portal.kernel.util.GetterUtil;
021 import com.liferay.portal.kernel.util.MultiValueMap;
022 import com.liferay.portal.kernel.util.MultiValueMapFactory;
023
024 import java.io.Serializable;
025
026
029 @DoPrivileged
030 public class MultiValueMapFactoryImpl implements MultiValueMapFactory {
031
032 public MultiValueMap<?, ?> getMultiValueMap(int type) {
033 if (type == MultiValueMapFactory.FILE) {
034 return new FileMultiValueMap<Serializable, Serializable>();
035 }
036 else {
037 return new MemoryMultiValueMap<Serializable, Serializable>();
038 }
039 }
040
041 public MultiValueMap<?, ?> getMultiValueMap(String propertyKey) {
042 int type = GetterUtil.getInteger(PropsUtil.get(propertyKey));
043
044 if (_log.isInfoEnabled()) {
045 _log.info("Using type " + type + " for " + propertyKey);
046 }
047
048 return getMultiValueMap(type);
049 }
050
051 private static Log _log = LogFactoryUtil.getLog(
052 MultiValueMapFactoryImpl.class);
053
054 }