org.jtool.jxplatform.io
Class FileWriter

java.lang.Object
  extended byorg.jtool.jxplatform.io.FileWriter

public class FileWriter
extends java.lang.Object

Writes characters into a file.

Author:
Katsuhisa Maruyama

Constructor Summary
FileWriter()
           
 
Method Summary
static void write(java.io.File file, java.lang.String text)
          Writes characters of a text into a file.
static void write(java.io.File file, java.lang.String text, java.lang.String charsetName)
          Writess characters of a text into the file.
static void write(java.lang.String name, java.lang.String text)
          Writes characters of a text into the file.
static void write(java.lang.String name, java.lang.String text, java.lang.String charsetName)
          Writes characters of a text into the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileWriter

public FileWriter()
Method Detail

write

public static void write(java.lang.String name,
                         java.lang.String text)
                  throws java.io.FileNotFoundException,
                         java.io.IOException
Writes characters of a text into the file.

Parameters:
name - The name of a file to be written.
text - The text of a file.
Throws:
java.io.FileNotFoundException - If the file did not exist or could not be opened for reading.
java.io.IOException - If an I/O error occurred.

write

public static void write(java.lang.String name,
                         java.lang.String text,
                         java.lang.String charsetName)
                  throws java.io.FileNotFoundException,
                         java.io.UnsupportedEncodingException,
                         java.io.IOException
Writes characters of a text into the file.

Parameters:
name - The name of a file to be written.
text - The text of a file.
charsetName - The name of a text's charset.
Throws:
java.io.FileNotFoundException - If the file did not exist or could not be opened for reading.
java.io.IOException - If an I/O error occurs
java.io.UnsupportedEncodingException

write

public static void write(java.io.File file,
                         java.lang.String text)
                  throws java.io.FileNotFoundException,
                         java.io.IOException
Writes characters of a text into a file.

Parameters:
file - A file to be written.
text - A text of the file.
Throws:
java.io.FileNotFoundException - If the file did not exist or could not be opened for reading.
java.io.IOException - If an I/O error occurred.

write

public static void write(java.io.File file,
                         java.lang.String text,
                         java.lang.String charsetName)
                  throws java.io.FileNotFoundException,
                         java.io.UnsupportedEncodingException,
                         java.io.IOException
Writess characters of a text into the file.

Parameters:
file - A file to be written.
text - The text of a file.
charsetName - The name of a text's charset.
Throws:
java.io.FileNotFoundException - If the file did not exist or could not be opened for reading.
java.io.UnsupportedEncodingException - If the charset is not supported.
java.io.IOException - If an I/O error occurred.