RequestData.java
3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* javax.servlet.ServletInputStream
* javax.servlet.http.HttpServletRequest
*/
package com.day.crx.delite.impl.support;
import com.day.crx.delite.impl.support.BlobFactory;
import com.day.crx.delite.impl.support.BlobFactoryImpl;
import com.day.crx.delite.impl.support.HttpMultipartPost;
import com.day.crx.delite.impl.support.RequestParameter;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
/*
* This class specifies class file version 49.0 but uses Java 6 signatures. Assumed Java 6.
*/
public class RequestData {
private final HttpServletRequest request;
private HttpMultipartPost mpReq;
private BlobFactory blobFactory;
public RequestData(HttpServletRequest request) {
this.request = request;
this.blobFactory = new BlobFactoryImpl();
this.mpReq = new HttpMultipartPost(this.blobFactory, request);
}
public void close() throws IOException {
this.blobFactory.close();
this.blobFactory = null;
}
public String getParameter(String name) {
String ret = this.mpReq.getParameter(name);
return ret == null ? this.request.getParameter(name) : ret;
}
public String getParameter(String name, String def) {
String ret = this.mpReq.getParameter(name);
if (ret == null) {
ret = this.request.getParameter(name);
}
return ret == null ? def : ret;
}
public Enumeration<String> getParameterNames() {
LinkedHashSet names = new LinkedHashSet(this.request.getParameterMap().keySet());
names.addAll(this.mpReq.getParameterNames());
return Collections.enumeration(names);
}
public Map<String, String[]> getParameterMap() {
LinkedHashMap<String, String[]> map = new LinkedHashMap<String, String[]>(this.request.getParameterMap());
map.putAll(this.mpReq.getParameterMap());
return map;
}
public String[] getParameterValues(String name) {
String[] ret = this.mpReq.getParameterValues(name);
return ret == null ? this.request.getParameterValues(name) : ret;
}
public String[] getParameterTypes(String name) {
String[] types = this.mpReq.getParameterTypes(name);
return types == null ? null : types;
}
public File getFileParameter(String name) throws IOException {
return this.mpReq.getFileParameter(name);
}
public RequestParameter getRequestParameter(String name) throws IOException {
return this.mpReq.getRequestParameter(name);
}
public File[] getFileParameters(String name) throws IOException {
return this.mpReq.getFileParameterValues(name);
}
public int getContentLength() {
return this.request.getContentLength();
}
public String getContentType() {
return this.request.getContentType();
}
public ServletInputStream getInputStream() throws IOException {
return this.request.getInputStream();
}
public BufferedReader getReader() throws IOException {
return this.request.getReader();
}
}