Revision 10366
Added by Jing Tao over 7 years ago
src/edu/ucsb/nceas/metacat/restservice/D1ResourceHandler.java | ||
---|---|---|
54 | 54 |
import org.dataone.service.types.v1.Session; |
55 | 55 |
import org.dataone.service.types.v1.Subject; |
56 | 56 |
import org.dataone.service.types.v1.SubjectInfo; |
57 |
import org.dataone.service.util.EncodingUtilities; |
|
57 | 58 |
|
58 | 59 |
import edu.ucsb.nceas.metacat.AuthSession; |
59 | 60 |
import edu.ucsb.nceas.metacat.MetacatHandler; |
... | ... | |
108 | 109 |
protected static final String FUNCTION_NAME_UPDATE = "update"; |
109 | 110 |
|
110 | 111 |
protected ServletContext servletContext; |
111 |
protected Logger logMetacat; |
|
112 |
protected static Logger logMetacat;
|
|
112 | 113 |
protected MetacatHandler handler; |
113 | 114 |
protected HttpServletRequest request; |
114 | 115 |
protected HttpServletResponse response; |
... | ... | |
552 | 553 |
if(s != null) { |
553 | 554 |
try |
554 | 555 |
{ |
555 |
result = URLDecoder.decode(s, "UTF-8");
|
|
556 |
result = EncodingUtilities.decodeString(s);
|
|
556 | 557 |
} |
557 | 558 |
catch (UnsupportedEncodingException e) |
558 | 559 |
{ |
560 |
s = s.replace("+", "%2B"); |
|
559 | 561 |
result = URLDecoder.decode(s); |
560 | 562 |
} |
563 |
logMetacat.info("D1ResourceHandler.decode - the string after decoding is "+result); |
|
561 | 564 |
System.out.println("After decoded: " + result); |
562 | 565 |
} |
563 | 566 |
|
Also available in: Unified diff
Use the EncodingUtilities method to decode a string.