public final class FileWriterWithName
extends java.io.FileWriter
FileWriter, but adds a getFileName() method and overrides #toString() to give the file name.| Constructor and Description |
|---|
FileWriterWithName(java.io.File file)
Constructs a FileWriterWithName object given a File object.
|
FileWriterWithName(java.io.File file,
boolean append)
Constructs a FileWriterWithName object given a File object.
|
FileWriterWithName(java.lang.String fileName)
Constructs a FileWriterWithName object given a file name.
|
FileWriterWithName(java.lang.String fileName,
boolean append)
Constructs a FileWriterWithName object given a file name with a boolean indicating whether or
not to append the data written.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getFileName()
Return the name of the file being written by this.
|
java.lang.String |
toString()
Return the name of the file being written by this.
|
public FileWriterWithName(java.lang.String fileName)
throws java.io.IOException
fileName - String The system-dependent filename.java.io.IOException - if the named file exists but is a directory rather than a regular file,
does not exist but cannot be created, or cannot be opened for any other reasonpublic FileWriterWithName(java.lang.String fileName,
boolean append)
throws java.io.IOException
fileName - String The system-dependent filename.append - boolean if true, then data will be written to the end of the file rather
than the beginning.java.io.IOException - if the named file exists but is a directory rather than a regular file,
does not exist but cannot be created, or cannot be opened for any other reasonpublic FileWriterWithName(java.io.File file)
throws java.io.IOException
file - a File object to write to.java.io.IOException - if the file exists but is a directory rather than a regular file, does not
exist but cannot be created, or cannot be opened for any other reasonpublic FileWriterWithName(java.io.File file,
boolean append)
throws java.io.IOException
true, then bytes will be written to the end of the file rather than the beginning.file - a File object to write toappend - if true, then bytes will be written to the end of the file rather than
the beginningjava.io.IOException - if the file exists but is a directory rather than a regular file, does not
exist but cannot be created, or cannot be opened for any other reason@Pure public java.lang.String getFileName( FileWriterWithName this)
@Pure public java.lang.String toString( FileWriterWithName this)
toString in class java.lang.Object