com.sun.faban.harness.agent
Interface FileService

All Superinterfaces:
Remote

public interface FileService
extends Remote

The methods in this interface are the public face of FileService They can be used by any remote object to access remote files. For example, the ToolAgent uses this class to copy the tool output files to the master machine. Objects of this class are created via the FileAgent.

Author:
Ramesh Ramachandran
See Also:
FileAgent

Method Summary
 void close()
          Close the current file.
 byte[] read()
          This method is responsible for reading a file.
 byte[] readBytes(int count)
          This method is responsible for writing to a file.
 void write(byte[] buffer)
          This method is responsible for writing to a file.
 void writeBytes(byte[] buffer, int begin, int end)
          This method is responsible for writing to a file.
 

Method Detail

read

byte[] read()
            throws RemoteException,
                   FileServiceException
This method is responsible for reading a file.

Returns:
The byte buffer read, null if end-of-file
Throws:
RemoteException - A communications error occurred
FileServiceException - Error opening the file

readBytes

byte[] readBytes(int count)
                 throws RemoteException,
                        FileServiceException
This method is responsible for writing to a file.

Parameters:
count - no. of bytes to read
Returns:
The byte buffer read, null if end-of-file
Throws:
RemoteException - A communications error occurred
FileServiceException - Error opening the file *

write

void write(byte[] buffer)
           throws RemoteException,
                  FileServiceException
This method is responsible for writing to a file.

Parameters:
buffer - to write
Throws:
RemoteException - A communications error occurred
FileServiceException - Error opening the file

writeBytes

void writeBytes(byte[] buffer,
                int begin,
                int end)
                throws RemoteException,
                       FileServiceException
This method is responsible for writing to a file.

Parameters:
buffer - to write
begin - staring index
end - ending index
Throws:
RemoteException - A communications error occurred
FileServiceException - Error opening the file

close

void close()
           throws RemoteException
Close the current file.

Throws:
RemoteException - A communications error occurred.