From e1804b3d0ef3be3db8be169043c6eae8a98bbc86 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Wed, 31 Oct 2012 23:32:29 +0530 Subject: 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.) --- conversion/ConvertDirectory.java | 13 ++++++++++--- conversion/ConvertFile.java | 5 ----- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'conversion') 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 @@ -33,11 +33,6 @@ public class ConvertFile { parsers = new ParserList().list(); } 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. -- cgit v1.2.3