|
Lines 141-147
Link Here
|
| 141 |
private boolean previousAuthenticationFailed = false; |
141 |
private boolean previousAuthenticationFailed = false; |
| 142 |
|
142 |
|
| 143 |
/** |
143 |
/** |
| 144 |
* Return the preferences node whose child nodes are teh know repositories |
144 |
* Return the preferences node whose child nodes are the know repositories |
| 145 |
* @return a preferences node |
145 |
* @return a preferences node |
| 146 |
*/ |
146 |
*/ |
| 147 |
public static Preferences getParentPreferences() { |
147 |
public static Preferences getParentPreferences() { |
|
Lines 149-155
Link Here
|
| 149 |
} |
149 |
} |
| 150 |
|
150 |
|
| 151 |
/** |
151 |
/** |
| 152 |
* Return a preferences node that contains suitabel defaults for a |
152 |
* Return a preferences node that contains suitable defaults for a |
| 153 |
* repository location. |
153 |
* repository location. |
| 154 |
* @return a preferences node |
154 |
* @return a preferences node |
| 155 |
*/ |
155 |
*/ |
|
Lines 548-558
Link Here
|
| 548 |
|
548 |
|
| 549 |
/* |
549 |
/* |
| 550 |
* Dispose of the receiver by clearing any cached authorization information. |
550 |
* Dispose of the receiver by clearing any cached authorization information. |
| 551 |
* This method shold only be invoked when the corresponding adapter is shut |
551 |
* This method should only be invoked when the corresponding adapter is shut |
| 552 |
* down or a connection is being validated. |
552 |
* down or a connection is being validated. |
| 553 |
*/ |
553 |
*/ |
| 554 |
public void dispose() { |
554 |
public void dispose() { |
| 555 |
flushCache(); |
555 |
removeNode(); |
| 556 |
try { |
556 |
try { |
| 557 |
if (hasPreferences()) { |
557 |
if (hasPreferences()) { |
| 558 |
internalGetPreferences().removeNode(); |
558 |
internalGetPreferences().removeNode(); |
|
Lines 564-577
Link Here
|
| 564 |
} |
564 |
} |
| 565 |
|
565 |
|
| 566 |
/* |
566 |
/* |
| 567 |
* Flush the keyring entry associated with the receiver |
567 |
* Clear and flush the keyring entry associated with the receiver |
| 568 |
*/ |
568 |
*/ |
| 569 |
private void flushCache() { |
569 |
private void removeNode() { |
| 570 |
ISecurePreferences node = getCVSNode(); |
570 |
ISecurePreferences node = getCVSNode(); |
| 571 |
if (node == null) |
571 |
if (node == null) |
| 572 |
return; |
572 |
return; |
| 573 |
try { |
573 |
try { |
| 574 |
node.flush(); |
574 |
node.clear(); |
|
|
575 |
node.flush(); // save immediately |
| 576 |
} catch (IllegalStateException e) { |
| 577 |
CVSProviderPlugin.log(IStatus.ERROR, e.getMessage(), e); |
| 575 |
} catch (IOException e) { |
578 |
} catch (IOException e) { |
| 576 |
CVSProviderPlugin.log(IStatus.ERROR, e.getMessage(), e); |
579 |
CVSProviderPlugin.log(IStatus.ERROR, e.getMessage(), e); |
| 577 |
} |
580 |
} |
|
Lines 889-896
Link Here
|
| 889 |
} |
892 |
} |
| 890 |
|
893 |
|
| 891 |
/* |
894 |
/* |
| 892 |
* The connection was sucessfully made. Update the cached |
895 |
* The connection was successfully made. Update the cached |
| 893 |
* repository location if it is a differnet instance than |
896 |
* repository location if it is a different instance than |
| 894 |
* this location. |
897 |
* this location. |
| 895 |
*/ |
898 |
*/ |
| 896 |
private void updateCachedLocation() { |
899 |
private void updateCachedLocation() { |
|
Lines 963-968
Link Here
|
| 963 |
// We set the password here but it will be cleared |
966 |
// We set the password here but it will be cleared |
| 964 |
// if the user info is cached using updateCache() |
967 |
// if the user info is cached using updateCache() |
| 965 |
this.password = password; |
968 |
this.password = password; |
|
|
969 |
// The password has been changed, reset the flag, so we won't |
| 970 |
// prompt before attempting to connect |
| 971 |
previousAuthenticationFailed = false; |
| 966 |
} |
972 |
} |
| 967 |
|
973 |
|
| 968 |
/* |
974 |
/* |
|
Lines 980-989
Link Here
|
| 980 |
|
986 |
|
| 981 |
public void setAllowCaching(boolean value) { |
987 |
public void setAllowCaching(boolean value) { |
| 982 |
allowCaching = value; |
988 |
allowCaching = value; |
| 983 |
if (allowCaching) |
989 |
if (allowCaching) { |
| 984 |
updateCache(); |
990 |
updateCache(); |
| 985 |
else |
991 |
} else { |
| 986 |
flushCache(); |
992 |
if (password == null) |
|
|
993 |
password = retrievePassword(); |
| 994 |
removeNode(); |
| 995 |
} |
| 987 |
} |
996 |
} |
| 988 |
|
997 |
|
| 989 |
public void updateCache() { |
998 |
public void updateCache() { |
|
Lines 1082-1088
Link Here
|
| 1082 |
* @see ICVSRepositoryLocation#flushUserInfo() |
1091 |
* @see ICVSRepositoryLocation#flushUserInfo() |
| 1083 |
*/ |
1092 |
*/ |
| 1084 |
public void flushUserInfo() { |
1093 |
public void flushUserInfo() { |
| 1085 |
flushCache(); |
1094 |
removeNode(); |
| 1086 |
} |
1095 |
} |
| 1087 |
|
1096 |
|
| 1088 |
/* |
1097 |
/* |