}
gopherBuilder.append(getLink(support.getDescription(),
- support.getSelector(), false));
+ support.getSelector(), true, false));
String ref = support.getSelector();
while (ref.startsWith("/")) {
}
ref = "../" + ref + "/index.html";
- htmlBuilder.append(getLink(support.getDescription(), ref, true));
+ htmlBuilder.append(getLink(support.getDescription(), ref, false,
+ true));
}
File gopherCache = new File(dir, preselector);
if (enoughStories || last) {
if (!last) {
gopherLines.add(getLink("More", support.getSelector()
- + ".cache_" + (page + 1), false));
+ + ".cache_" + (page + 1), false, false));
htmlLines.add(getLink("More", "index_" + (page + 1)
- + ".html", true));
+ + ".html", false, true));
}
write(gopherLines, varDir, ".cache", "", page);
}
}
- private String getLink(String name, String ref, boolean html) {
+ private String getLink(String name, String ref, boolean index, boolean html) {
if (!html) {
- return new StringBuilder().append("1" + name).append("\t")
- .append("1" + ref) //
+ return new StringBuilder().append((index ? "0" : "1") + name)
+ .append("\t").append("1" + ref) //
.append("\t").append(hostname) //
.append("\t").append(Integer.toString(port)) //
.append("\r\n").toString();