diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-11-29 14:28:43 +0100 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-12-01 16:55:11 +0100 |
commit | 99edb798a22b9020408eb4331c77f01b76b033cb (patch) | |
tree | 17e2c859a4ab97c20a6acc80a48f5080482e0c50 /sonar-plugin-api | |
parent | 780b00c00c57ed90190eb5eed2799af4095354c7 (diff) | |
download | sonarqube-99edb798a22b9020408eb4331c77f01b76b033cb.tar.gz sonarqube-99edb798a22b9020408eb4331c77f01b76b033cb.zip |
SONAR-8416 move handling logic out from UnauthorizedException
and to AuthenticationError
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/server/authentication/UnauthorizedException.java | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/authentication/UnauthorizedException.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/authentication/UnauthorizedException.java index a2713e5d87e..190e8afc497 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/authentication/UnauthorizedException.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/authentication/UnauthorizedException.java @@ -19,12 +19,6 @@ */ package org.sonar.api.server.authentication; -import com.google.common.base.Charsets; -import java.io.UnsupportedEncodingException; - -import static java.lang.String.format; -import static java.net.URLEncoder.encode; - /** * This exception should be used when a functional error is generated by an Identity Provider plugin. * The user will be redirected to an unauthorized page and the exception's message will be displayed in the UI. @@ -33,9 +27,6 @@ import static java.net.URLEncoder.encode; */ public class UnauthorizedException extends RuntimeException { - public static final String UNAUTHORIZED_PATH = "/sessions/unauthorized"; - private static final String UNAUTHORIZED_PATH_WITH_MESSAGE = UNAUTHORIZED_PATH + "?message=%s"; - public UnauthorizedException(String message) { super(message); } @@ -43,16 +34,4 @@ public class UnauthorizedException extends RuntimeException { public UnauthorizedException(String message, Throwable cause) { super(message, cause); } - - public String getPath() { - return format(UNAUTHORIZED_PATH_WITH_MESSAGE, encodeMessage(getMessage())); - } - - private static String encodeMessage(String message) { - try { - return encode(message, Charsets.UTF_8.name()); - } catch (UnsupportedEncodingException unsupportedException) { - throw new IllegalStateException(format("Fail to encode %s", message), unsupportedException); - } - } } |