hashMap.put(key, style);
}
- public void removeAll() throws TransformerConfigurationException, SAXException, IOException {
+ public void removeAll()
+ {
String key;
Style style;
Iterator i = hashMap.keySet().iterator();
return applyStylesheet(style.stylesheet, keys[idx].params, applyRec(keys, idx - 1, saxOutput));
}
}
-
+//FileNotFoundException
public void apply(String inFile, OutputStream outputStream, Key[] keys, Properties userProperties)
- throws FileNotFoundException, IOException, TransformerConfigurationException, SAXException, Exception
+ throws IOException, TransformerConfigurationException, SAXException, Exception
{
/* File outFile = new File(outFilename);
if (outFile.exists())
public void reload(String key) throws TransformerConfigurationException, SAXException, IOException {
Style style = (Style)hashMap.get(key);
-
- log("reloading \"" + key + "\"... ");
- style.stylesheet = compileStylesheet(style.fileName);
- style.lastModified = new File(style.fileName).lastModified();
- log("done!");
+ if (style != null) {
+ log("reloading \"" + key + "\"... ");
+ style.stylesheet = compileStylesheet(style.fileName);
+ style.lastModified = new File(style.fileName).lastModified();
+ log("done!");
+ } else {
+ log("error, stylesheet \"" + key + "\" not loaded");
+ }
}
public void updateAll() throws TransformerConfigurationException, SAXException, IOException {
public void update(String key) throws TransformerConfigurationException, SAXException, IOException {
Style style = (Style)hashMap.get(key);
-
- log("updating \"" + key + "\"... ");
- File styleFile = new File(style.fileName);
- if (styleFile.lastModified() > style.lastModified) {
- style.stylesheet = compileStylesheet(style.fileName);
- style.lastModified = styleFile.lastModified();
- log("done!");
- } else
- log("\"" + key + "\" is up to date");
+ if (style != null) {
+ log("updating \"" + key + "\"... ");
+ File styleFile = new File(style.fileName);
+ if (styleFile.lastModified() > style.lastModified) {
+ style.stylesheet = compileStylesheet(style.fileName);
+ style.lastModified = styleFile.lastModified();
+ log("done!");
+ } else {
+ log("\"" + key + "\" is up to date");
+ }
+ } else {
+ log("error, stylesheet \"" + key + "\" not loaded");
+ }
}
}