public final class FileWriter
extends java.lang.Object
The class wraps all IOException
s which occur during its operations in the
IllegalStateException
.
Modifier and Type | Method and Description |
---|---|
void |
append(CodeLines jsOutput)
Appends the given output to the end of the file.
|
static FileWriter |
createFor(io.spine.code.fs.js.Directory directory,
com.google.protobuf.Descriptors.FileDescriptor file)
Creates a new instance which will operate on the file pointed by the file descriptor
and located in the specified directory.
|
static FileWriter |
createFor(io.spine.code.fs.js.Directory directory,
io.spine.code.fs.js.LibraryFile libraryFile)
Creates a new instance which will operate on the specified library file located in
the specified directory.
|
void |
write(CodeLines jsOutput)
Writes the given output to the file.
|
public static FileWriter createFor(io.spine.code.fs.js.Directory directory, io.spine.code.fs.js.LibraryFile libraryFile)
public static FileWriter createFor(io.spine.code.fs.js.Directory directory, com.google.protobuf.Descriptors.FileDescriptor file)
public void write(CodeLines jsOutput)
Overwrites the previous file content.
jsOutput
- the JsOutput
to writejava.lang.IllegalStateException
- if something went wrong when writing to filepublic void append(CodeLines jsOutput)
jsOutput
- the JsOutput
to appendjava.lang.IllegalStateException
- if something went wrong when writing to file