/*****************************************************************
** JavaType - program to mimic DOS TYPE command
**
** Since java programs are exectuted (interpreted) by the
** 'java' program, this program must be exectued as follows:
**
**    PROMPT>java JavaType temp.txt
**
** The contents of the file 'temp.txt' are sent to the standard
** output (the console).
**
** (c) Scott MacKenzie, 2000                             
******************************************************************/
import java.io.*;

public class JavaType
{
   public static void main(String[] args) throws IOException
   {
      if (args.length < 1)
      {
         System.out.println("Required parameter missing");
         return;
      }
      else if (args.length > 1)
      {
         System.out.println("Too many parameters");
         return;
      }

      File f = new File(args[0]);
      if (!f.exists())
      {
         System.out.println("File not found - " + args[0]);
         return;
      }

      // open disk file for input
      BufferedReader inputFile =
         new BufferedReader(new FileReader(args[0]));

      // read lines from the disk file, write lines to console
      String s;
      while ((s = inputFile.readLine()) != null)
         System.out.println(s);

      // close disk file
      inputFile.close(); 
   }
}

