org.safs.staf.service
Class SAFSFile

java.lang.Object
  extended by org.safs.text.FileLineReader
      extended by org.safs.staf.service.SAFSFile
Direct Known Subclasses:
SAFSTextFile

public class SAFSFile
extends FileLineReader

Copyright 2003 SAS Institute GNU General Public License (GPL) http://www.opensource.org/licenses/gpl-license.php

This SAFSFile class is intended as the file instance class for a SAFSFileReader.
Although there are no STAF dependencies, the class is tightly integrated with the reader. It has not been evaluated for any other use. Though, standalone use is likely possible.

This class represents the most basic reader functionality. It will simply read a line of text for each call to readLine(). It uses a java.io.BufferedReader as the underlying IO mechanism.

See Also:
Software Automation Framework Support (SAFS) http://safsdev.sourceforge.net
Software Testing Automation Framework (STAF) http://staf.sourceforge.net

Field Summary
protected  java.lang.String fileid
           
protected  int handle
           
protected  java.lang.String machine
           
protected  java.lang.String process
           
 
Fields inherited from class org.safs.text.FileLineReader
DEFAULT_BUFFER_SIZE, eof, file, filename, firstline, fullpath, linetext, reader, stream
 
Constructor Summary
SAFSFile()
          This constructor will create an inoperable (Closed) file object.
SAFSFile(java.lang.String machine, java.lang.String process, int handle, java.lang.String fileid, java.io.File file)
          The constructor used by the SAFSFileReader.
 
Method Summary
 java.lang.String getFileID()
          Subclasses should not need to override this function.
 int getHandle()
          Subclasses should not need to override this function.
 java.lang.String getMachine()
          Subclasses should not need to override this function.
 java.lang.String getProcess()
          Subclasses should not need to override this function.
 
Methods inherited from class org.safs.text.FileLineReader
close, closeReader, getFilename, getFullpath, isClosed, isEOF, open, openFile, openStream, readLine, resetpointers, setFile, setStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

machine

protected java.lang.String machine

process

protected java.lang.String process

handle

protected int handle

fileid

protected java.lang.String fileid
Constructor Detail

SAFSFile

public SAFSFile()
This constructor will create an inoperable (Closed) file object. No use whatsoever. :)


SAFSFile

public SAFSFile(java.lang.String machine,
                java.lang.String process,
                int handle,
                java.lang.String fileid,
                java.io.File file)
The constructor used by the SAFSFileReader. All subclasses MUST invoke this constructor prior to completing their initialization.
Invoke this constructor from the subclass with:

    super(machine, process, handle, fileid, file);

Parameters:
machine - The STAF machine that requested this file be opened.
process - The STAF process that requested this file be opened.
handle - The STAF process handle that requested this file be opened.
fileid - A unique String ID to identify this file for the requesting process. This is not a filename. Multiple open views of the same file can be opened and each should have a unique fileid within the process namespace.
file - A File object that references the file to be opened.
Method Detail

getMachine

public java.lang.String getMachine()
Subclasses should not need to override this function.

Returns:
the value of the machine constructor parameter

getProcess

public java.lang.String getProcess()
Subclasses should not need to override this function.

Returns:
the value of the process constructor parameter

getFileID

public java.lang.String getFileID()
Subclasses should not need to override this function.

Returns:
the value of the fileid constructor parameter

getHandle

public int getHandle()
Subclasses should not need to override this function.

Returns:
the value of the handle constructor parameter