git://git.nikiroo.be
/
gofetch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
...
[gofetch.git]
/
src
/
be
/
nikiroo
/
gofetch
/
Fetcher.java
diff --git
a/src/be/nikiroo/gofetch/Fetcher.java
b/src/be/nikiroo/gofetch/Fetcher.java
index 496b2f7602c59e6d7330b15d41626f6d14e5dcb7..7490037c201929aba38297d809e7f9c917af1e95 100644
(file)
--- a/
src/be/nikiroo/gofetch/Fetcher.java
+++ b/
src/be/nikiroo/gofetch/Fetcher.java
@@
-85,7
+85,7
@@
public class Fetcher {
}
gopherBuilder.append(getLink(support.getDescription(),
}
gopherBuilder.append(getLink(support.getDescription(),
- support.getSelector(), false));
+ support.getSelector(),
true,
false));
String ref = support.getSelector();
while (ref.startsWith("/")) {
String ref = support.getSelector();
while (ref.startsWith("/")) {
@@
-93,7
+93,8
@@
public class Fetcher {
}
ref = "../" + ref + "/index.html";
}
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);
}
File gopherCache = new File(dir, preselector);
@@
-196,10
+197,10
@@
public class Fetcher {
boolean last = i == headers.length - 1;
if (enoughStories || last) {
if (!last) {
boolean last = i == headers.length - 1;
if (enoughStories || last) {
if (!last) {
- gopherLines.add(getLink("More",
"/.cache_" + (page + 1),
- false));
+ gopherLines.add(getLink("More",
support.getSelector()
+
+ ".cache_" + (page + 1), false,
false));
htmlLines.add(getLink("More", "index_" + (page + 1)
htmlLines.add(getLink("More", "index_" + (page + 1)
- + ".html", true));
+ + ".html",
false,
true));
}
write(gopherLines, varDir, ".cache", "", page);
}
write(gopherLines, varDir, ".cache", "", page);
@@
-226,10
+227,10
@@
public class Fetcher {
}
}
}
}
- 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")
if (!html) {
return new StringBuilder().append("1" + name).append("\t")
- .append(
"1"
+ ref) //
+ .append(
(index ? "1" : "0")
+ ref) //
.append("\t").append(hostname) //
.append("\t").append(Integer.toString(port)) //
.append("\r\n").toString();
.append("\t").append(hostname) //
.append("\t").append(Integer.toString(port)) //
.append("\r\n").toString();