|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.wurbelizer.SourceFile
public class SourceFile
In-memory file to check for changes before close/flush. Manages a static set of such SourceFiles that can be closed and thus released at one (meant to be attached to a single SourceDocument).
| Method Summary | |
|---|---|
void |
close()
Closes the file. |
static void |
closeAll()
Closes all files and clears the vector |
void |
flush()
Flushs the file (overwrite existing file or create a new one). |
String |
getNewText()
Gets the new text/contents of the file. |
String |
getOrgText()
Gets the original text (contents) of the file. |
PrintStream |
getStream()
Gets a stream for the file to be rewritten. |
static void |
initialize()
Discard all files in list, if any. |
boolean |
needsFlush()
Checks whether the file is changed and needs a flush for persistance. |
static SourceFile |
open(String filename)
Opens the file and load into memory. |
static void |
resetAll()
Rewinds all output streams (makes them empty again). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static SourceFile open(String filename)
throws IOException
filename - the filename
IOException - if reading the file did failpublic String getOrgText()
public PrintStream getStream()
public String getNewText()
public boolean needsFlush()
public void flush()
throws FileNotFoundException,
IOException
FileNotFoundException - if file cannpt be created
IOException - if flush failed
public void close()
throws FileNotFoundException,
IOException
FileNotFoundException - if file cannpt be created
IOException - if flush failedpublic static void initialize()
public static void resetAll()
public static void closeAll()
throws FileNotFoundException,
IOException
FileNotFoundException
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||