summaryrefslogtreecommitdiffstats
path: root/styling/StyleChecker.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 /styling/StyleChecker.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 'styling/StyleChecker.java')
-rw-r--r--styling/StyleChecker.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/styling/StyleChecker.java b/styling/StyleChecker.java
index 68d7b46..e70170a 100644
--- a/styling/StyleChecker.java
+++ b/styling/StyleChecker.java
@@ -23,18 +23,22 @@ package scruf.styling;
import scruf.io.*;
import java.io.*;
+
public class StyleChecker {
private File styleSheet;
private File curDir;
private String styleContent;
-
- public void resolve(File curDir) {
+ // the default style sheet in scruf package.
+ private File scrufStyleSheet = new File("scruf/styling/style.css");
+ public void check(File curDir) {
this.curDir = curDir.getAbsoluteFile();
styleSheet = new File(curDir,"style.css");
- // if style shee doesn't exists, copy default sheet
- // to the directory.
- if(!styleSheet.exists()) {
- styleContent = new ReadFile(new File("scruf/styling/style.css")).getContent();
+ // if style sheet doesn't exists or if the default style is newer
+ // than style sheet in the directory, copy default sheet to the
+ // directory.
+ if((!styleSheet.exists()) ||
+ scrufStyleSheet.lastModified() > styleSheet.lastModified()) {
+ styleContent = new ReadFile(scrufStyleSheet).getContent();
new WriteFile(styleSheet,styleContent).write();
}
}