Revision: 1e295381e548 Branch: default Author: John Boyer <john.boyer@xxxxxxxxxxxxxxxxx> Date: Mon Jan 14 06:43:16 2013 Log: more fixes on DocumentBase http://code.google.com/p/brailleblaster/source/detail?r=1e295381e548&repo=newdesign Modified: /src/main/org/brailleblaster/document/DocumentBase.java =======================================--- /src/main/org/brailleblaster/document/DocumentBase.java Sun Jan 13 22:03:03 2013 +++ /src/main/org/brailleblaster/document/DocumentBase.java Mon Jan 14 06:43:16 2013
@@ -86,6 +86,11 @@ * @param completePath Complete path to where the file should be saved */ public void saveWorkingFile (String completePath) { +int extPos = completePath.lastIndexOf (".") + 1; +String ext = completePath.substring (extPos); +if (!ext.equalsIgnoreCase ("utd")) { +throw new IllegalArgumentException ("File name must end in 'utd'."); +} sm.saveWorkingFile (completePath); } @@ -148,7 +153,7 @@ "outFile.utd"; String logFile = BBIni.getLogFilesPath() + fileSep + "liblouisutdml.log"; -boolean success; +boolean success = false; int extPos = completePath.lastIndexOf (".") + 1; String ext = completePath.substring (extPos); if (ext.equalsIgnoreCase ("xml")) { @@ -165,12 +170,16 @@ success = lutdml.backTranslateFile (configFileWithPath, completePath, outFile, logFile, configWithUTD, 0); +} else +if (ext.equalsIgnoreCase ("utd")) { +sm.makeSemantics (completePath); +success = true; } else { throw new IllegalArgumentException (completePath + " not .xml, .txt, or .brf"); } +new CheckLiblouisutdmlLog().displayLog(); if (!success) { -new CheckLiblouisutdmlLog().displayLog(); return false; } sm.makeSemantics (outFile);