134 |
String s = CopyUtil.readString(block.getInputStream()); |
String s = CopyUtil.readString(block.getInputStream()); |
135 |
|
|
136 |
String prefix = ""; |
String prefix = ""; |
137 |
if(rewrite) prefix = ROOTURL+REWRITE+"/"; |
if(rewrite) { |
138 |
if(backlinks) prefix += BACKLINKS+"/"; |
prefix = ROOTURL+REWRITE+"/"; |
139 |
|
if(backlinks) prefix += BACKLINKS+"/"; |
140 |
|
} |
141 |
|
|
142 |
if(rewrite) |
if(rewrite) |
143 |
s = rewriteURIs(s, prefix); |
s = rewriteURIs(s, prefix); |
144 |
|
|
|
/* XXX If no rewrite, should the links be URNs or backlinks/ */ |
|
145 |
if(backlinks) |
if(backlinks) |
146 |
s = insertBacklinks(s, prefix, id); |
s = insertBacklinks(s, prefix, id); |
147 |
|
|
231 |
for(Iterator i=ids.iterator(); i.hasNext();) { |
for(Iterator i=ids.iterator(); i.hasNext();) { |
232 |
BlockId id = (BlockId)i.next(); |
BlockId id = (BlockId)i.next(); |
233 |
String s = id.getURI(); |
String s = id.getURI(); |
234 |
if(rewrite) s = base + s; |
if(rewrite || id.getContentType().equals("text/html")) |
235 |
|
s = base + s; |
236 |
w.write("<a href=\""+s+"\">"+id+"</a><br>\n"); |
w.write("<a href=\""+s+"\">"+id+"</a><br>\n"); |
237 |
} |
} |
238 |
} |
} |