FormFieldRequestParameter.java
1.74 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.sling.api.request.RequestParameter
* org.slf4j.Logger
* org.slf4j.LoggerFactory
*/
package com.adobe.aemds.guide.submitutils;
import com.adobe.aemds.guide.service.GuideException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import org.apache.sling.api.request.RequestParameter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class FormFieldRequestParameter
implements RequestParameter {
private String parameterValue;
private Logger logger = LoggerFactory.getLogger(FormFieldRequestParameter.class);
public FormFieldRequestParameter(String parameterValue) {
this.parameterValue = parameterValue;
}
public InputStream getInputStream() {
InputStream is = null;
return is;
}
public String getFileName() {
return null;
}
public boolean isFormField() {
return true;
}
public String getContentType() {
return null;
}
public String getName() {
return null;
}
public byte[] get() {
return this.parameterValue.getBytes();
}
public String getString() {
return this.parameterValue;
}
public String getString(String encoding) {
String result = null;
try {
byte[] bytes = this.get();
result = new String(bytes, encoding);
}
catch (UnsupportedEncodingException e) {
this.logger.error("Exception in encoding : " + e.getMessage(), (Throwable)e);
throw new GuideException(e);
}
return result;
}
public long getSize() {
byte[] bytes = this.get();
return bytes.length;
}
}