Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 103819
Collapse All | Expand All

(-)src/org/eclipse/wst/internet/cache/internal/CachePlugin.java (-6 / +6 lines)
Lines 37-47 Link Here
37
  private static CachePlugin plugin;
37
  private static CachePlugin plugin;
38
38
39
  /**
39
  /**
40
   * The plugin's resource bundle.
41
   */
42
  private ResourceBundle resourceBundle;
43
44
  /**
45
   * The cache job caches resources that were not able to be downloaded when requested.
40
   * The cache job caches resources that were not able to be downloaded when requested.
46
   */
41
   */
47
  private CacheJob job = null;
42
  private CacheJob job = null;
Lines 105-110 Link Here
105
	for(int i = 0; i < numLicenses; i++)
100
	for(int i = 0; i < numLicenses; i++)
106
	{
101
	{
107
	  Integer state = registry.getLicenseState(licenses[i]);
102
	  Integer state = registry.getLicenseState(licenses[i]);
103
      // For states that have been disagreed to this session store
104
	  // them as disagree.
105
	  if(state == LicenseRegistry.LICENSE_DISAGREE_THIS_SESSION)
106
	  {
107
		state = LicenseRegistry.LICENSE_DISAGREE;
108
	  }
108
	  prefs.setValue(licenses[i], state.intValue());
109
	  prefs.setValue(licenses[i], state.intValue());
109
	}
110
	}
110
	
111
	
Lines 112-118 Link Here
112
	stopJob();
113
	stopJob();
113
	super.stop(context);
114
	super.stop(context);
114
	plugin = null;
115
	plugin = null;
115
	resourceBundle = null;
116
  }
116
  }
117
117
118
  /**
118
  /**
(-)src/org/eclipse/wst/internet/cache/internal/LicenseRegistry.java (-1 / +24 lines)
Lines 25-30 Link Here
25
  protected static Integer LICENSE_UNSPECIFIED = new Integer(0); // This needs to be 0 for the plugin prefs.
25
  protected static Integer LICENSE_UNSPECIFIED = new Integer(0); // This needs to be 0 for the plugin prefs.
26
  protected static Integer LICENSE_AGREE = new Integer(1);
26
  protected static Integer LICENSE_AGREE = new Integer(1);
27
  protected static Integer LICENSE_DISAGREE = new Integer(2);
27
  protected static Integer LICENSE_DISAGREE = new Integer(2);
28
  // Signifies a license that has been disagreed to this session.
29
  protected static Integer LICENSE_DISAGREE_THIS_SESSION = new Integer(3);
28
  
30
  
29
  protected final static String _LOG_INFO_WTP_NO_USER_INTERACTION = "_LOG_INFO_WTP_NO_USER_INTERACTION";
31
  protected final static String _LOG_INFO_WTP_NO_USER_INTERACTION = "_LOG_INFO_WTP_NO_USER_INTERACTION";
30
  
32
  
Lines 115-120 Link Here
115
  }
117
  }
116
  
118
  
117
  /**
119
  /**
120
   * Disagree to the specified license for this session. The license is disagreed to only if it has already
121
   * been registered with the registry. 
122
   * 
123
   * @param url The URL of the license to accept.
124
   */
125
  private void disagreeLicenseThisSession(String url)
126
  {
127
	if(licenses.containsKey(url))
128
	{
129
	  licenses.put(url, LICENSE_DISAGREE_THIS_SESSION);
130
	}
131
  }
132
  
133
  /**
118
   * Determine if the license has been accepted. This method will return true if the license
134
   * Determine if the license has been accepted. This method will return true if the license
119
   * has been accepted or is not registered with the registry and false if it has not been accepted. 
135
   * has been accepted or is not registered with the registry and false if it has not been accepted. 
120
   * 
136
   * 
Lines 140-146 Link Here
140
	  {
156
	  {
141
		if(!CachePlugin.getDefault().shouldPrompt())
157
		if(!CachePlugin.getDefault().shouldPrompt())
142
		  return false;
158
		  return false;
159
		licenses.put(licenseURL, LICENSE_DISAGREE_THIS_SESSION);
160
	  }
161
	  // The license has already been disagreed to this session. Do not prompt.
162
	  else if(agreed == LICENSE_DISAGREE_THIS_SESSION)
163
	  {
164
		return false;
143
	  }
165
	  }
166
		  
144
	  
167
	  
145
	  // Prompt the user to accept the license.
168
	  // Prompt the user to accept the license.
146
	  if(promptToAcceptLicense(url, licenseURL))
169
	  if(promptToAcceptLicense(url, licenseURL))
Lines 148-154 Link Here
148
		agreeLicense(licenseURL);
171
		agreeLicense(licenseURL);
149
		return true;
172
		return true;
150
	  }
173
	  }
151
	  disagreeLicense(licenseURL);
174
	  disagreeLicenseThisSession(licenseURL);
152
	  return false;
175
	  return false;
153
	}
176
	}
154
	
177
	

Return to bug 103819