summaryrefslogtreecommitdiffstats
path: root/conversion
diff options
context:
space:
mode:
authorrsiddharth <rsiddharth@ninthfloor.org>2012-10-31 23:32:29 +0530
committerrsiddharth <rsiddharth@ninthfloor.org>2012-10-31 23:32:29 +0530
commite1804b3d0ef3be3db8be169043c6eae8a98bbc86 (patch)
tree028ceccfd1f006a051e789c081e539b234eaae61 /conversion
parent1f61844084d9e9383b3be04ff8f60c11eb628075 (diff)
added:
status/ status/DirectoryInfo.java (record the directory 'level' at which scruf is parsing with respect to 'root' directory.) modified: Scruf.java (added a line to start the directory level count at zero) conversion/ConvertDirectory.java (DirectoryInfo.level used to take count of directory 'leve') conversion/ConvertFile.java (lines related to 'footer' things were removed) io/PresentFile.java ( 'footer' & 'backButton' field removed) parsers/BackButton.java (back button placement happens in the parse method itself, instead of doing it in Header.java) (back button is not placed, if the present directory is root directory) parsers/Footer.java (footer placement happens in the parse method itself, instead of doing it in Header.java) parsers/Header.java (back button placement & footer placement removed.)
Diffstat (limited to 'conversion')
-rw-r--r--conversion/ConvertDirectory.java13
-rw-r--r--conversion/ConvertFile.java5
2 files changed, 10 insertions, 8 deletions
diff --git a/conversion/ConvertDirectory.java b/conversion/ConvertDirectory.java
index 3dbb8eb..2a0f6a9 100644
--- a/conversion/ConvertDirectory.java
+++ b/conversion/ConvertDirectory.java
@@ -23,6 +23,7 @@ package scruf.conversion;
import java.io.*;
import scruf.index.*;
+import scruf.status.*;
public class ConvertDirectory {
private ConvertFile html;
@@ -41,22 +42,28 @@ public class ConvertDirectory {
// index creator for the present directory.
IndexCreator index = new IndexCreator(directory);
// iterate through the directory.
+ System.out.println("Current Directory: "+directory.getAbsolutePath());
for(File file:directory.listFiles(new FileSieve())) {
if(file.isFile()) {
can = canConvert.check(file);
if(can) {
- System.out.println("Converting..."+file.getName());
+ System.out.println("Converting..."+file.getAbsolutePath());
html.convert(file);
index.add(file);
}
}
else if(file.isDirectory()) {
- this.convert(file);
+ ++DirectoryInfo.level;
+ this.convert(file);
}
}
boolean convertIndex = (index.shouldConvert() ||
canConvert.check(index.indexFile()));
- if(convertIndex)
+ if(convertIndex) {
+ System.out.println("Converting..."+index.indexFile().getAbsolutePath());
html.convert(index.indexFile());
+ }
+ --DirectoryInfo.level;
}
+
}
diff --git a/conversion/ConvertFile.java b/conversion/ConvertFile.java
index 6767717..4f2d7bd 100644
--- a/conversion/ConvertFile.java
+++ b/conversion/ConvertFile.java
@@ -34,11 +34,6 @@ public class ConvertFile {
}
public void convert(File file) {
/**
- * footer is optional, so it is null
- * by default.
- */
- PresentFile.footer = null;
- /**
* takes the present file reference
* for use outside this method.
*/