summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <rsiddharth@ninthfloor.org>2012-10-31 22:00:35 +0530
committerrsiddharth <rsiddharth@ninthfloor.org>2012-10-31 22:00:35 +0530
commit1f61844084d9e9383b3be04ff8f60c11eb628075 (patch)
tree069d147029f06b5a5e82b92a20c440ea3ab802ec
parent0019988533c9c1b2a4bfad50b3e0427babefb1bb (diff)
modified:
conversion/ConvertDirectory.java (minor edit) index/IndexCreator.java (removed code which (1) creates a index file, if it is not present (2) checks for the existence of index.html) io/WriteFile.java (made the stdout message more verbose) parsers/Header.java ('scruf' footer links to scruf's project page) todo (1 task completed)
-rw-r--r--conversion/ConvertDirectory.java1
-rw-r--r--index/IndexCreator.java19
-rw-r--r--io/WriteFile.java2
-rw-r--r--parsers/Header.java2
-rw-r--r--todo3
5 files changed, 4 insertions, 23 deletions
diff --git a/conversion/ConvertDirectory.java b/conversion/ConvertDirectory.java
index 3b70a71..3dbb8eb 100644
--- a/conversion/ConvertDirectory.java
+++ b/conversion/ConvertDirectory.java
@@ -54,7 +54,6 @@ public class ConvertDirectory {
this.convert(file);
}
}
-
boolean convertIndex = (index.shouldConvert() ||
canConvert.check(index.indexFile()));
if(convertIndex)
diff --git a/index/IndexCreator.java b/index/IndexCreator.java
index f86f03a..ef683f7 100644
--- a/index/IndexCreator.java
+++ b/index/IndexCreator.java
@@ -39,13 +39,6 @@ public class IndexCreator {
if(index.exists()) {
indexContent.append(new ReadFile(index).
getContent());
- }else {
- try {
- index.createNewFile();
- }catch(IOException e) {
- throw new RuntimeException("Unable to create file: "+
- index.getAbsolutePath(),e);
- }
}
}
public void add(File file) {
@@ -61,19 +54,9 @@ public class IndexCreator {
}
}
public boolean shouldConvert() {
- // we assume that index.html exists.
- boolean indexHTMLExists=true;
if(modified)
new WriteFile(index,indexContent.toString()).write();
- // Check for this existence of index.html.
- if(!(new File(directory,"index.html").exists())) {
- indexHTMLExists=false;
- }
- /**
- * returns true either when 'index' is modified or
- * when index.html does not exists.
- */
- return (modified || !indexHTMLExists);
+ return (modified);
}
public File indexFile() {
return index;
diff --git a/io/WriteFile.java b/io/WriteFile.java
index d19bb72..0a2a1e7 100644
--- a/io/WriteFile.java
+++ b/io/WriteFile.java
@@ -32,7 +32,7 @@ public class WriteFile {
}
public void write() {
try {
- System.out.println("Writing..."+outputFile.getName());
+ System.out.println("Writing..."+outputFile.getAbsolutePath());
BufferedWriter bwriter = new BufferedWriter
(new FileWriter(outputFile));
// write content to file.
diff --git a/parsers/Header.java b/parsers/Header.java
index eebec5d..5cf2c55 100644
--- a/parsers/Header.java
+++ b/parsers/Header.java
@@ -55,7 +55,7 @@ public class Header implements Parser {
sbuilder.append("</article>\n");
// add "powered by scruf" at bottom of page.
sbuilder.append("\n<div class=\"scruf\">\n");
- sbuilder.append("<a href=\"/scruf/\">powered by scruf</a>");
+ sbuilder.append("<a href=\"https://savannah.nongnu.org/projects/scruf/\">powered by scruf</a>");
sbuilder.append("\n</div>\n");
// Close body tag
sbuilder.append("\n</body>\n");
diff --git a/todo b/todo
index fefc7f1..a302bdd 100644
--- a/todo
+++ b/todo
@@ -1,5 +1,4 @@
-# IndexCreator must be modified -- the existence of indexHtml can be
- checked using CanConvert object.
+# the root page (of a site) should not have a ''home'' or ''back'' button.
# Test it by generating your _full_ homepage using scruf.