diff options
Diffstat (limited to 'plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/UsernamePasswordCallback.java')
-rw-r--r-- | plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/UsernamePasswordCallback.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/UsernamePasswordCallback.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/UsernamePasswordCallback.java index caeb92f1d734..ad908b213ab3 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/UsernamePasswordCallback.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/UsernamePasswordCallback.java @@ -15,7 +15,9 @@ */ package org.jetbrains.idea.svn.commandLine; +import com.intellij.openapi.util.text.StringUtil; import org.jetbrains.annotations.NotNull; +import org.jetbrains.idea.svn.auth.AuthenticationService; import org.tmatesoft.svn.core.SVNURL; import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; import org.tmatesoft.svn.core.auth.SVNAuthentication; @@ -32,6 +34,7 @@ import java.util.regex.Pattern; */ public class UsernamePasswordCallback extends AuthCallbackCase { + private static final String COULD_NOT_AUTHENTICATE_TO_SERVER_MESSAGE = "could not authenticate to server"; private static final String UNABLE_TO_CONNECT_MESSAGE = "Unable to connect to a repository"; private static final String AUTHENTICATION_FAILED_MESSAGE = "Authentication failed"; private static final String INVALID_CREDENTIALS_FOR_SVN_PROTOCOL = "svn: E170001: Can't get"; @@ -40,8 +43,8 @@ public class UsernamePasswordCallback extends AuthCallbackCase { protected SVNAuthentication myAuthentication; - UsernamePasswordCallback(@NotNull AuthenticationCallback callback, SVNURL url) { - super(callback, url); + UsernamePasswordCallback(@NotNull AuthenticationService authenticationService, SVNURL url) { + super(authenticationService, url); } @Override @@ -52,13 +55,14 @@ public class UsernamePasswordCallback extends AuthCallbackCase { // svn protocol invalid credentials - messages could be "Can't get password", "Can't get username or password" error.contains(INVALID_CREDENTIALS_FOR_SVN_PROTOCOL) && error.contains(PASSWORD_STRING) || // http/https protocol, svn 1.7, non-interactive - error.contains(UNABLE_TO_CONNECT_MESSAGE); + error.contains(UNABLE_TO_CONNECT_MESSAGE) || + // http, svn 1.6, non-interactive + StringUtil.containsIgnoreCase(error, COULD_NOT_AUTHENTICATE_TO_SERVER_MESSAGE); } @Override boolean getCredentials(String errText) throws SvnBindException { - myAuthentication = myAuthenticationCallback.requestCredentials(myUrl != null ? myUrl : parseUrlFromError(errText), - getType()); + myAuthentication = myAuthenticationService.requestCredentials(myUrl != null ? myUrl : parseUrlFromError(errText), getType()); return myAuthentication != null; } |