Java Reference
In-Depth Information
L ISTING D.9 Continued
* Returns an array of Strings containing the names of all
the entries for a given URL.
public String[] getNames(URL urlKey) throws, {
File f = new File(sysDir, transformURL(urlKey));
return f.list();
* Returns an int corresponding to the current value of the tag
* for the persistent data store entry associated with the given URL.
public int getTag(URL parm1) throws, {
System.out.println(“Method getTag() not yet implemented.”);
return CACHED;
* Tags the persistent data store entry associated
with the given URL with the given tag value.
public void setTag(URL parm1, int parm2) throws, {
System.out.println(“Method setTag() not yet implemented.”);
* transform an URl into a local file system path as a String
private String transformURL(URL url) {
String s = url.toString().substring(url.toString().indexOf(“://”)+2);
StringBuffer stringbuffer = new StringBuffer(url.getProtocol());
for(int j = 0; j < s.length(); j++)
if(s.charAt(j) == '/') {
} else
if(s.charAt(j) == '&')
if(s.charAt(j) == ':')
Search WWH ::

Custom Search