コード例 #1
0
 // return the first that knows username + password; otherwise return the first that knows just the
 // username
 @Nullable
 private Pair<GitHttpAuthDataProvider, AuthData> findBestAuthData(@NotNull String url) {
   Pair<GitHttpAuthDataProvider, AuthData> candidate = null;
   for (GitHttpAuthDataProvider provider : getProviders()) {
     AuthData data = provider.getAuthData(url);
     if (data != null) {
       Pair<GitHttpAuthDataProvider, AuthData> pair = Pair.create(provider, data);
       if (data.getPassword() != null) {
         return pair;
       }
       if (candidate == null) {
         candidate = pair;
       }
     }
   }
   return candidate;
 }
コード例 #2
0
 @Override
 public void forgetPassword() {
   LOG.debug(
       "forgetPassword. dataProvider="
           + getCurrentDataProviderName()
           + ", unifiedUrl="
           + myUnifiedUrl);
   if (myDataProvider != null && myUnifiedUrl != null) {
     myDataProvider.forgetPassword(myUnifiedUrl);
   }
 }
コード例 #3
0
 @Nullable
 private String getCurrentDataProviderName() {
   return myDataProvider == null ? null : myDataProvider.getClass().getName();
 }