1 12 13 package org.eclipse.update.internal.core; 14 15 import java.net.URL ; 16 import java.util.Collections ; 17 import java.util.HashSet ; 18 import java.util.Set ; 19 20 public class UpdateSession { 21 22 private boolean enabled = false; 23 private Set visitedURLs = Collections.synchronizedSet(new HashSet ()); 24 25 UpdateSession() { 26 } 27 28 public boolean isVisited(URL url) { 29 if (!enabled) 30 return false; 31 return visitedURLs.contains(url.toExternalForm()); 32 } 33 34 public void markVisited(URL url) { 35 if (!enabled) 36 return ; 37 visitedURLs.add(url.toExternalForm()); 38 } 39 40 45 public void reset() { 46 this.enabled = true; 47 visitedURLs.clear(); 48 } 49 50 } 51 | Popular Tags |