summaryrefslogtreecommitdiffstats
path: root/conversion/ConvertDirectory.java
diff options
context:
space:
mode:
authorrsiddharth <rsiddharth@ninthfloor.org>2012-12-21 13:25:10 +0530
committerrsiddharth <rsiddharth@ninthfloor.org>2012-12-21 13:25:10 +0530
commit7f46c19441f6690bde92c1359c535321cb8c3025 (patch)
tree73ad82bfba3ed35fa9707d73ae7c0dd4c63c6eb6 /conversion/ConvertDirectory.java
parentbed3dc00c9112d70966990ca66ab0a078b5ca0b5 (diff)
parent03ab823d0318865544c54baaaa0b4ebb63fae4fa (diff)
merged from devel branch.
removed: Scruf.java todo added: Run.java TODO parsers/SymbolMap.java modified: conversion/ConvertDirectory.java parsers/BackButton.java parsers/CodeBlocks.java parsers/WordDecoration.java styling/StyleChecker.java styling/style.css pending merges: rsiddharth 2012-12-21 [bug-fix]: when the default style sheet is newer than the style sheet rsiddharth 2012-12-21 Scruf.java has been renamed to Run.java rsiddharth 2012-12-21 [method named changed]: The method named 'resolve()' in styling/StyleChecker.java is changed ... rsiddharth 2012-12-21 [bug-fix]: Each directory is checked if it contains the style.css, if rsiddharth 2012-12-21 added license text to parsers/SymbolMap.java. rsiddharth 2012-12-21 updated TODO rsiddharth 2012-12-20 [bug-fix]: From now on, all the special characters in the string rsiddharth 2012-12-20 SymbolMap class which was in CodeBlock.java is shifted to a dedicated rsiddharth 2012-12-20 [bug-fix]: Back Buttons were not put in webpages that were present in rsiddharth 2012-12-15 bunch of new todos; 'todo' renamed to 'TODO'.
Diffstat (limited to 'conversion/ConvertDirectory.java')
-rw-r--r--conversion/ConvertDirectory.java29
1 files changed, 21 insertions, 8 deletions
diff --git a/conversion/ConvertDirectory.java b/conversion/ConvertDirectory.java
index a5717bb..87a0145 100644
--- a/conversion/ConvertDirectory.java
+++ b/conversion/ConvertDirectory.java
@@ -25,14 +25,18 @@ import java.io.*;
import scruf.index.*;
import scruf.status.*;
import scruf.conversion.ignore.*;
+import scruf.styling.*;
public class ConvertDirectory {
private ConvertFile html;
private CanConvert canConvert;
private boolean can;
+ private StyleChecker styleSheet;
+ private boolean styleFlag;
public ConvertDirectory() {
- html = new ConvertFile();
- canConvert = new CanConvert();
+ html = new ConvertFile();
+ canConvert = new CanConvert();
+ styleSheet = new StyleChecker();
}
public void convert(File directory) {
if(!directory.isDirectory()) {
@@ -47,14 +51,18 @@ public class ConvertDirectory {
IndexCreator index = new IndexCreator(directory);
// iterate through the directory.
System.out.println("Current Directory: "+directory.getAbsolutePath());
+ // reset styleFlag.
+ styleFlag = false;
for(File file:directory.listFiles(new FileSieve())) {
if(file.isFile()) {
- can = canConvert.check(file);
- if(can) {
- System.out.println("Converting..."+file.getAbsolutePath());
- html.convert(file);
- index.add(file);
- }
+ can = canConvert.check(file);
+ if(can) {
+ System.out.println("Converting..."+file.getAbsolutePath());
+ html.convert(file);
+ index.add(file);
+ // set styleFlag.
+ styleFlag = true;
+ }
}
else if(file.isDirectory()) {
// Perform conversion, only if, directory
@@ -65,6 +73,11 @@ public class ConvertDirectory {
}
}
}
+ // if styleFlag is set, check for style sheet in
+ // in the directory.
+ if(styleFlag) {
+ styleSheet.check(directory);
+ }
boolean convertIndex = (index.shouldConvert() ||
canConvert.check(index.indexFile()));
if(convertIndex) {