comparison gwt-client/src/main/java/org/dive4elements/river/client/server/auth/was/Request.java @ 8203:238fc722f87a

sed 's/logger/log/g' src/**/*.java
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 05 Sep 2014 13:19:22 +0200
parents ea9eef426962
children 0a5239a1e46e
comparison
equal deleted inserted replaced
8202:e4606eae8ea5 8203:238fc722f87a
20 private final static String VERSION = "1.1"; 20 private final static String VERSION = "1.1";
21 private final static String REQUEST_SAML_RESPONSE = "GetSAMLResponse"; 21 private final static String REQUEST_SAML_RESPONSE = "GetSAMLResponse";
22 private final static String METHOD_AUTH_PASSWORD = 22 private final static String METHOD_AUTH_PASSWORD =
23 "urn:opengeospatial:authNMethod:OWS:1.0:password"; 23 "urn:opengeospatial:authNMethod:OWS:1.0:password";
24 24
25 private static Logger logger = Logger.getLogger(Request.class); 25 private static Logger log = Logger.getLogger(Request.class);
26 26
27 public Request(String uri) { 27 public Request(String uri) {
28 String request = uri + "?VERSION=" + VERSION + "&REQUEST=" + 28 String request = uri + "?VERSION=" + VERSION + "&REQUEST=" +
29 REQUEST_SAML_RESPONSE + "&METHOD=" + METHOD_AUTH_PASSWORD + 29 REQUEST_SAML_RESPONSE + "&METHOD=" + METHOD_AUTH_PASSWORD +
30 "&ANONYMOUS=TRUE&CREDENTIALS="; 30 "&ANONYMOUS=TRUE&CREDENTIALS=";
41 "&CREDENTIALS=" + base64user + "," + base64pass; 41 "&CREDENTIALS=" + base64user + "," + base64pass;
42 42
43 this.setURI(URI.create(request)); 43 this.setURI(URI.create(request));
44 } 44 }
45 catch(UnsupportedEncodingException e) { 45 catch(UnsupportedEncodingException e) {
46 logger.error(e); 46 log.error(e);
47 } 47 }
48 } 48 }
49 49
50 private String toBase64(String value, String encoding) throws 50 private String toBase64(String value, String encoding) throws
51 UnsupportedEncodingException { 51 UnsupportedEncodingException {
54 } 54 }
55 try { 55 try {
56 return new String(Base64.encodeBase64(value.getBytes(encoding))); 56 return new String(Base64.encodeBase64(value.getBytes(encoding)));
57 } 57 }
58 catch(UnsupportedEncodingException e) { 58 catch(UnsupportedEncodingException e) {
59 logger.warn("Can't encode string with encoding " + encoding + 59 log.warn("Can't encode string with encoding " + encoding +
60 ". Falling back to utf-8. " + e); 60 ". Falling back to utf-8. " + e);
61 return this.toBase64(value, "utf-8"); 61 return this.toBase64(value, "utf-8");
62 } 62 }
63 } 63 }
64 64

http://dive4elements.wald.intevation.org