xdev.niodev
Class ConfigReader

java.lang.Object
  extended by xdev.niodev.ConfigReader

public class ConfigReader
extends java.lang.Object

This class is a utiliy class that is used to read the start-up information from a configuration file. The users of the mpjdev do not have to deal with this file.


Constructor Summary
ConfigReader(java.lang.String fileName)
          Constructor of this utility class
 
Method Summary
 void close()
          Close all the streams.
static void main(java.lang.String[] args)
          Just for testing this class ! ! !
 java.lang.String readIntAsString()
          Reads integer as a string
 java.lang.String readLine()
          Reads line from the configuration file.
 java.lang.String readNoOfProc()
          Read the number of processes mentioned in the configuration file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigReader

public ConfigReader(java.lang.String fileName)
             throws java.io.IOException,
                    java.io.FileNotFoundException,
                    java.net.MalformedURLException
Constructor of this utility class

Parameters:
fileName - String The name of the configuration file. This can be on the local file system or on some server accessible via http.
Throws:
java.io.IOException - If some I/O error happens.
java.io.FileNotFoundException - If the file is not found.
java.net.MalformedURLException - If the http URL is malformed.
Method Detail

readNoOfProc

public java.lang.String readNoOfProc()
                              throws java.io.IOException
Read the number of processes mentioned in the configuration file.

Returns:
String The number of total processes
Throws:
java.io.IOException - If some I/O error occurs

readIntAsString

public java.lang.String readIntAsString()
                                 throws java.io.IOException
Reads integer as a string

Returns:
String
Throws:
java.io.IOException

readLine

public java.lang.String readLine()
                          throws java.io.IOException
Reads line from the configuration file.

Returns:
String
Throws:
java.io.IOException

close

public void close()
Close all the streams.


main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Just for testing this class ! ! !

Throws:
java.lang.Exception