Java Reference
In-Depth Information
L ISTING 11.5 Continued
System.out.println(getClass()+”.read(“+url+”): “+e);
}
return object;
}
public boolean exists(URL url){
try {
if (persistenceService.getNames(url).length>0)
return true;
} catch (Exception e) {
System.out.println(getClass()+”.exists(“+url+”): “+e);
}
return false;
}
public void synchronize(String keyString) {
synchronize(getUrl(keyString));
}
public void synchronize(URL url) {
try {
if (persistenceService.getTag(url)==PersistenceService.DIRTY)
persistenceService.setTag(url, persistenceService.CACHED);
} catch (Exception e) {
System.out.println(getClass()+”.synchronize(“+url+”): “+e);
}
}
public void removeEntry(URL url) {
try {
persistenceService.delete(url);
} catch (Exception e) {
System.out.println(getClass()+”.remove(“+url+”): “+e);
}
}
public List getEntries(String keyString) {
return getEntries(getUrl(keyString));
}
public List getEntries(URL url) {
List list =null;
try {
list=
Collections.unmodifiableList(
Arrays.asList(persistenceService.getNames(url)));
} catch (Exception e) {
System.out.println(getClass()+”.getEntries(“+url+”): “+e);
}
return list;
Search WWH ::




Custom Search