public class XMLWriter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
filDir
System-dependent directory name of the xml file.
|
protected java.lang.String |
filNam
Name of the xml file.
|
protected int |
porNo
Integer port number for BSD socket.
|
Constructor and Description |
---|
XMLWriter(java.lang.String fileDirectory,
java.lang.String fileName,
int portNo)
Construct an instance and assign all data members.
|
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] arg)
Main method that can be used for testing.
|
void |
write()
Write the xml file.
|
protected int porNo
protected java.lang.String filDir
protected java.lang.String filNam
public XMLWriter(java.lang.String fileDirectory, java.lang.String fileName, int portNo)
fileDirectory
- The system-dependent directory name.fileName
- The system-dependent filename.portNo
- The port number for BSD socket.public void write() throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
- 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.java.io.IOException
- if an I/O error occurs.public static void main(java.lang.String[] arg)
arg
- An array of Strings, the first argument being a integer
that names a file called test-XXX.txt.