|
9 | 9 | import java.io.OutputStream; |
10 | 10 | import java.io.StringReader; |
11 | 11 | import java.io.UnsupportedEncodingException; |
12 | | -import java.math.BigInteger; |
13 | | -import java.net.URISyntaxException; |
14 | 12 | import java.net.URL; |
15 | 13 | import java.net.URLDecoder; |
16 | 14 | import java.net.URLEncoder; |
17 | 15 | import java.nio.charset.Charset; |
18 | | -import java.nio.file.Files; |
19 | | -import java.nio.file.Path; |
20 | | -import java.nio.file.Paths; |
21 | 16 | import java.security.GeneralSecurityException; |
22 | 17 | import java.security.InvalidKeyException; |
23 | 18 | import java.security.KeyFactory; |
24 | | -import java.security.MessageDigest; |
25 | 19 | import java.security.NoSuchAlgorithmException; |
26 | 20 | import java.security.NoSuchProviderException; |
27 | 21 | import java.security.Key; |
|
33 | 27 | import java.security.cert.X509Certificate; |
34 | 28 | import java.security.spec.PKCS8EncodedKeySpec; |
35 | 29 | import java.util.Calendar; |
36 | | -import java.util.HashMap; |
37 | 30 | import java.util.Iterator; |
38 | 31 | import java.util.Locale; |
39 | | -import java.util.Map; |
40 | | -import java.util.Random; |
41 | 32 | import java.util.TimeZone; |
42 | 33 | import java.util.UUID; |
43 | 34 | import java.util.zip.Deflater; |
@@ -553,80 +544,6 @@ public static String convertToPem(X509Certificate certificate) { |
553 | 544 | return pemCert; |
554 | 545 | } |
555 | 546 |
|
556 | | - /** |
557 | | - * Redirect to location url |
558 | | - * |
559 | | - * @param response |
560 | | - * HttpServletResponse object to be used |
561 | | - * @param location |
562 | | - * target location url |
563 | | - * @param parameters |
564 | | - * GET parameters to be added |
565 | | - * |
566 | | - * @throws IOException |
567 | | - * |
568 | | - * @see javax.servlet.http.HttpServletResponse#sendRedirect(String) |
569 | | - */ |
570 | | - public static void sendRedirect(HttpServletResponse response, String location, Map<String, String> parameters) throws IOException { |
571 | | - String target = location; |
572 | | - |
573 | | - if (!parameters.isEmpty()) { |
574 | | - boolean first = !location.contains("?"); |
575 | | - for (Map.Entry<String, String> parameter : parameters.entrySet()) |
576 | | - { |
577 | | - if (first) { |
578 | | - target += "?"; |
579 | | - first = false; |
580 | | - } else { |
581 | | - target += "&"; |
582 | | - } |
583 | | - target += parameter.getKey(); |
584 | | - if (!parameter.getValue().isEmpty()) { |
585 | | - target += "=" + Util.urlEncoder(parameter.getValue()); |
586 | | - } |
587 | | - } |
588 | | - } |
589 | | - response.sendRedirect(target); |
590 | | - } |
591 | | - |
592 | | - /** |
593 | | - * Redirect to location url |
594 | | - * |
595 | | - * @param response |
596 | | - * HttpServletResponse object to be used |
597 | | - * @param location |
598 | | - * target location url |
599 | | - * |
600 | | - * @throws IOException |
601 | | - * |
602 | | - * @see javax.servlet.http.HttpServletResponse#sendRedirect(String) |
603 | | - */ |
604 | | - public static void sendRedirect(HttpServletResponse response, String location) throws IOException { |
605 | | - Map<String, String> parameters =new HashMap<String, String>(); |
606 | | - sendRedirect(response, location, parameters); |
607 | | - } |
608 | | - |
609 | | - |
610 | | - /** |
611 | | - * Returns the protocol + the current host + the port (if different than |
612 | | - * common ports). |
613 | | - * |
614 | | - * @param request |
615 | | - * HttpServletRequest object to be processed |
616 | | - * |
617 | | - * @return the HOST URL |
618 | | - */ |
619 | | - public static String getSelfURLhost(HttpServletRequest request) { |
620 | | - String hostUrl = StringUtils.EMPTY; |
621 | | - final int serverPort = request.getServerPort(); |
622 | | - if ((serverPort == 80) || (serverPort == 443) || serverPort == 0) { |
623 | | - hostUrl = String.format("%s://%s", request.getScheme(), request.getServerName()); |
624 | | - } else { |
625 | | - hostUrl = String.format("%s://%s:%s", request.getScheme(), request.getServerName(), serverPort); |
626 | | - } |
627 | | - return hostUrl; |
628 | | - } |
629 | | - |
630 | 547 | /** |
631 | 548 | * Loads a resource located at a relative path |
632 | 549 | * |
|
0 commit comments