|
|
|
@ -17,9 +17,7 @@ |
|
|
|
package org.springframework.web.portlet.context; |
|
|
|
package org.springframework.web.portlet.context; |
|
|
|
|
|
|
|
|
|
|
|
import java.security.Principal; |
|
|
|
import java.security.Principal; |
|
|
|
import java.util.Collections; |
|
|
|
|
|
|
|
import java.util.Iterator; |
|
|
|
import java.util.Iterator; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Locale; |
|
|
|
import java.util.Locale; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
import javax.portlet.PortletRequest; |
|
|
|
import javax.portlet.PortletRequest; |
|
|
|
@ -27,13 +25,9 @@ import javax.portlet.PortletResponse; |
|
|
|
import javax.portlet.PortletSession; |
|
|
|
import javax.portlet.PortletSession; |
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
import org.springframework.util.LinkedMultiValueMap; |
|
|
|
|
|
|
|
import org.springframework.util.MultiValueMap; |
|
|
|
|
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
import org.springframework.web.context.request.NativeWebRequest; |
|
|
|
import org.springframework.web.context.request.NativeWebRequest; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
import org.springframework.web.multipart.MultipartRequest; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* {@link org.springframework.web.context.request.WebRequest} adapter |
|
|
|
* {@link org.springframework.web.context.request.WebRequest} adapter |
|
|
|
@ -44,8 +38,6 @@ import org.springframework.web.multipart.MultipartRequest; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class PortletWebRequest extends PortletRequestAttributes implements NativeWebRequest { |
|
|
|
public class PortletWebRequest extends PortletRequestAttributes implements NativeWebRequest { |
|
|
|
|
|
|
|
|
|
|
|
private MultipartRequest multipartRequest; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private PortletResponse response; |
|
|
|
private PortletResponse response; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -55,9 +47,6 @@ public class PortletWebRequest extends PortletRequestAttributes implements Nativ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public PortletWebRequest(PortletRequest request) { |
|
|
|
public PortletWebRequest(PortletRequest request) { |
|
|
|
super(request); |
|
|
|
super(request); |
|
|
|
if (request instanceof MultipartRequest) { |
|
|
|
|
|
|
|
this.multipartRequest = (MultipartRequest) request; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
@ -166,43 +155,6 @@ public class PortletWebRequest extends PortletRequestAttributes implements Nativ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
|
|
|
|
public Iterator<String> getFileNames() { |
|
|
|
|
|
|
|
if (this.multipartRequest == null) { |
|
|
|
|
|
|
|
return (Iterator<String>) Collections.EMPTY_SET.iterator(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return this.multipartRequest.getFileNames(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public MultipartFile getFile(String name) { |
|
|
|
|
|
|
|
if (this.multipartRequest == null) { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return this.multipartRequest.getFile(name); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<MultipartFile> getFiles(String name) { |
|
|
|
|
|
|
|
if (this.multipartRequest == null) { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return this.multipartRequest.getFiles(name); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Map<String, MultipartFile> getFileMap() { |
|
|
|
|
|
|
|
if (this.multipartRequest == null) { |
|
|
|
|
|
|
|
return Collections.emptyMap(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return this.multipartRequest.getFileMap(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public MultiValueMap<String, MultipartFile> getMultiFileMap() { |
|
|
|
|
|
|
|
if (this.multipartRequest == null) { |
|
|
|
|
|
|
|
return new LinkedMultiValueMap<String, MultipartFile>(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return this.multipartRequest.getMultiFileMap(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String toString() { |
|
|
|
public String toString() { |
|
|
|
return "PortletWebRequest: " + getDescription(true); |
|
|
|
return "PortletWebRequest: " + getDescription(true); |
|
|
|
|