|
Lines 18-23
Link Here
|
| 18 |
import org.eclipse.ecf.core.security.ConnectContextFactory; |
18 |
import org.eclipse.ecf.core.security.ConnectContextFactory; |
| 19 |
import org.eclipse.ecf.core.security.IConnectContext; |
19 |
import org.eclipse.ecf.core.security.IConnectContext; |
| 20 |
import org.eclipse.ecf.filetransfer.UserCancelledException; |
20 |
import org.eclipse.ecf.filetransfer.UserCancelledException; |
|
|
21 |
import org.eclipse.equinox.internal.p2.repository.Credentials.LoginCanceledException; |
| 21 |
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; |
22 |
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; |
| 22 |
import org.eclipse.equinox.internal.provisional.p2.core.IServiceUI.AuthenticationInfo; |
23 |
import org.eclipse.equinox.internal.provisional.p2.core.IServiceUI.AuthenticationInfo; |
| 23 |
import org.eclipse.equinox.internal.provisional.p2.repository.IStateful; |
24 |
import org.eclipse.equinox.internal.provisional.p2.repository.IStateful; |
|
Lines 92-97
Link Here
|
| 92 |
return statusOn(target, RepositoryStatus.forException(e, toDownload), reader); |
93 |
return statusOn(target, RepositoryStatus.forException(e, toDownload), reader); |
| 93 |
} catch (AuthenticationFailedException e) { |
94 |
} catch (AuthenticationFailedException e) { |
| 94 |
promptUser = true; |
95 |
promptUser = true; |
|
|
96 |
} catch (Credentials.LoginCanceledException e) { |
| 97 |
DownloadStatus status = new DownloadStatus(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_AUTHENTICATION, // |
| 98 |
NLS.bind(Messages.UnableToRead_0_UserCanceled, toDownload), null); |
| 99 |
return statusOn(target, status, null); |
| 100 |
|
| 95 |
} |
101 |
} |
| 96 |
} |
102 |
} |
| 97 |
// reached maximum number of retries without success |
103 |
// reached maximum number of retries without success |
|
Lines 147-152
Link Here
|
| 147 |
if (e.getStatus().getException() == null) |
153 |
if (e.getStatus().getException() == null) |
| 148 |
throw new CoreException(RepositoryStatus.forException(e, toDownload)); |
154 |
throw new CoreException(RepositoryStatus.forException(e, toDownload)); |
| 149 |
throw new CoreException(RepositoryStatus.forStatus(e.getStatus(), toDownload)); |
155 |
throw new CoreException(RepositoryStatus.forStatus(e.getStatus(), toDownload)); |
|
|
156 |
} catch (LoginCanceledException e) { |
| 157 |
// i.e. same behavior when user cancels as when failing n attempts. |
| 158 |
throw new AuthenticationFailedException(); |
| 150 |
} |
159 |
} |
| 151 |
} |
160 |
} |
| 152 |
throw new AuthenticationFailedException(); |
161 |
throw new AuthenticationFailedException(); |
|
Lines 202-207
Link Here
|
| 202 |
throw new CoreException(RepositoryStatus.forStatus(e.getStatus(), toDownload)); |
211 |
throw new CoreException(RepositoryStatus.forStatus(e.getStatus(), toDownload)); |
| 203 |
} catch (AuthenticationFailedException e) { |
212 |
} catch (AuthenticationFailedException e) { |
| 204 |
promptUser = true; |
213 |
promptUser = true; |
|
|
214 |
} catch (LoginCanceledException e) { |
| 215 |
// same behavior as if user failed n attempts. |
| 216 |
throw new AuthenticationFailedException(); |
| 205 |
} |
217 |
} |
| 206 |
} |
218 |
} |
| 207 |
// reached maximum number of authentication retries without success |
219 |
// reached maximum number of authentication retries without success |