allensoft.javacvs.client
Class CVSCommunicationsObject

java.lang.Object
  |
  +--allensoft.javacvs.client.CVSCommunicationsObject
Direct Known Subclasses:
CVSRequest, CVSResponse, Options

public abstract class CVSCommunicationsObject
extends java.lang.Object

The base class for any object that wants to do communications with a CVS server. This provides many protected methods for sending common requests and receiving input from the server. They are forawrded on to the client to actually send to the server.


Constructor Summary
CVSCommunicationsObject()
           
 
Method Summary
protected  ExpandModulesResponse expandModules(java.lang.String[] modules)
           
protected  void flush()
          Flushes the output stream to the server.
protected abstract  CVSClient getClient()
          Gets the client object that is used to communicate with the server.
protected abstract  java.io.File getCurrentDirectory()
          Gets the current directory for this communications object.
protected  java.io.File getFileFromRelativePath(java.lang.String sRelativePath)
          Gets a file from a relative path received from the server.
protected  java.lang.String getRelativePath(java.io.File file)
          Gets the relative path from this request's working directory to the supplied file.
protected  java.lang.String getRelativePath(FileEntry file)
          Gets a relative path to the supplied file entry from this request's working directory.
protected  java.lang.String getRelativePath(WorkingDirectory workingDirectory)
          Gets a relative path to the supplied working directory from this request's working directory.
protected  GetWrapperRCSOptionsResponse getWrapperRCSOptions()
           
protected  CVSResponse performSubRequest(CVSRequest request)
          Performs the supplied request without trying to open a connection to the server.
protected  void receiveFile(java.io.File fileToSaveAs)
           
protected  void receiveFile(java.io.OutputStream out)
           
protected  java.lang.String receiveLine()
           
protected  void sendArgument(java.io.File file)
           
protected  void sendArgument(FileEntry file)
           
protected  void sendArgument(java.lang.String sArgument)
           
protected  void sendArgument(WorkingDirectory workingDirectory)
           
protected  void sendCheckinProg(java.lang.String sProg)
           
protected  void sendCurrentDirectory()
           
protected  void sendDateOption(java.util.Date date)
           
protected  void sendDirectory(java.io.File directory, java.lang.String sRepositoryPath)
           
protected  void sendDirectory(WorkingDirectory workingDirectory)
          Sends a "Directory" command to the server.
protected  void sendEntry(FileEntry entry)
          Sends an "Entry" command to the server.
protected  void sendFileDetails(java.io.File file)
           
protected  void sendFileDetails(FileEntry entry)
          Sends the details of a file to the server.
protected  void sendFileDetails(java.io.File file, KeywordSubstitutionMode mode)
           
protected  void sendGlobalOption(java.lang.String sOption)
           
protected  void sendKopt(KeywordSubstitutionMode mode)
           
protected  void sendLine(java.lang.String sText)
          Sends a line to the server.
protected  void sendModified(java.io.File file)
          Sends a "Modified" command to the server.
protected  void sendOptions(Options options)
          Sends some options to the server.
protected  void sendStaticDirectory()
           
protected  void sendSticky(java.lang.String sTagSpec)
           
protected  void sendText(java.lang.String s)
          Sends some text to the server.
protected  void sendUnchanged(java.lang.String sName)
           
protected  void sendUpdateProg(java.lang.String sProg)
           
protected  void sendWorkingDirectoryDetails(WorkingDirectory workingDir)
           
protected  void sendWorkingDirectoryDetails(WorkingDirectory workingDir, boolean bRecursive)
           
protected  void sendWorkingDirectoryDetails(WorkingDirectory workingDir, boolean bRecursive, FileEntryFilter fileEntryFilter)
          Sends the details of an entire working directory to the server.
protected  ValidRequestsResponse validRequests()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CVSCommunicationsObject

public CVSCommunicationsObject()
Method Detail

getClient

protected abstract CVSClient getClient()
Gets the client object that is used to communicate with the server.

getCurrentDirectory

protected abstract java.io.File getCurrentDirectory()
Gets the current directory for this communications object.

getRelativePath

protected java.lang.String getRelativePath(java.io.File file)
Gets the relative path from this request's working directory to the supplied file.

getRelativePath

protected java.lang.String getRelativePath(FileEntry file)
Gets a relative path to the supplied file entry from this request's working directory.

getRelativePath

protected java.lang.String getRelativePath(WorkingDirectory workingDirectory)
Gets a relative path to the supplied working directory from this request's working directory.

getFileFromRelativePath

protected java.io.File getFileFromRelativePath(java.lang.String sRelativePath)
Gets a file from a relative path received from the server. The file is relative to the current directory specified in the request object that this is the response to.

sendText

protected void sendText(java.lang.String s)
                 throws java.io.IOException
Sends some text to the server.

sendLine

protected void sendLine(java.lang.String sText)
                 throws java.io.IOException,
                        CVSException
Sends a line to the server. The line is terminated with a '\n' charater.

sendDirectory

protected void sendDirectory(java.io.File directory,
                             java.lang.String sRepositoryPath)
                      throws java.io.IOException,
                             CVSException

sendDirectory

protected void sendDirectory(WorkingDirectory workingDirectory)
                      throws java.io.IOException,
                             CVSException
Sends a "Directory" command to the server.

sendKopt

protected void sendKopt(KeywordSubstitutionMode mode)
                 throws java.io.IOException,
                        CVSException

sendCurrentDirectory

protected void sendCurrentDirectory()
                             throws CVSException,
                                    java.io.IOException

sendStaticDirectory

protected void sendStaticDirectory()
                            throws java.io.IOException,
                                   CVSException

sendSticky

protected void sendSticky(java.lang.String sTagSpec)
                   throws java.io.IOException,
                          CVSException

sendCheckinProg

protected void sendCheckinProg(java.lang.String sProg)
                        throws java.io.IOException,
                               CVSException

sendUpdateProg

protected void sendUpdateProg(java.lang.String sProg)
                       throws java.io.IOException,
                              CVSException

sendEntry

protected void sendEntry(FileEntry entry)
                  throws java.io.IOException,
                         CVSException
Sends an "Entry" command to the server.

sendModified

protected void sendModified(java.io.File file)
                     throws java.io.IOException,
                            CVSException
Sends a "Modified" command to the server.

sendArgument

protected void sendArgument(java.lang.String sArgument)
                     throws java.io.IOException,
                            CVSException

sendUnchanged

protected void sendUnchanged(java.lang.String sName)
                      throws java.io.IOException,
                             CVSException

sendArgument

protected void sendArgument(java.io.File file)
                     throws java.io.IOException,
                            CVSException

sendArgument

protected void sendArgument(FileEntry file)
                     throws java.io.IOException,
                            CVSException

sendArgument

protected void sendArgument(WorkingDirectory workingDirectory)
                     throws java.io.IOException,
                            CVSException

sendDateOption

protected void sendDateOption(java.util.Date date)
                       throws java.io.IOException,
                              CVSException

sendGlobalOption

protected void sendGlobalOption(java.lang.String sOption)
                         throws java.io.IOException,
                                CVSException

sendOptions

protected void sendOptions(Options options)
                    throws java.io.IOException,
                           CVSException
Sends some options to the server.

sendFileDetails

protected void sendFileDetails(FileEntry entry)
                        throws java.io.IOException,
                               CVSException
Sends the details of a file to the server. This is an accumulation of a Directory, Entry and Modified (or Unchanged) command.

sendFileDetails

protected void sendFileDetails(java.io.File file,
                               KeywordSubstitutionMode mode)
                        throws java.io.IOException,
                               CVSException

sendFileDetails

protected void sendFileDetails(java.io.File file)
                        throws java.io.IOException,
                               CVSException

sendWorkingDirectoryDetails

protected void sendWorkingDirectoryDetails(WorkingDirectory workingDir,
                                           boolean bRecursive,
                                           FileEntryFilter fileEntryFilter)
                                    throws java.io.IOException,
                                           CVSException
Sends the details of an entire working directory to the server.

sendWorkingDirectoryDetails

protected void sendWorkingDirectoryDetails(WorkingDirectory workingDir,
                                           boolean bRecursive)
                                    throws java.io.IOException,
                                           CVSException

sendWorkingDirectoryDetails

protected void sendWorkingDirectoryDetails(WorkingDirectory workingDir)
                                    throws java.io.IOException,
                                           CVSException

performSubRequest

protected CVSResponse performSubRequest(CVSRequest request)
                                 throws java.io.IOException,
                                        CVSException
Performs the supplied request without trying to open a connection to the server. It assumes the client has already opened a connection to the server and is already performing a request.

expandModules

protected ExpandModulesResponse expandModules(java.lang.String[] modules)
                                       throws java.io.IOException,
                                              CVSException

validRequests

protected ValidRequestsResponse validRequests()
                                       throws java.io.IOException,
                                              CVSException

getWrapperRCSOptions

protected GetWrapperRCSOptionsResponse getWrapperRCSOptions()
                                                     throws java.io.IOException,
                                                            CVSException

flush

protected void flush()
              throws java.io.IOException
Flushes the output stream to the server.

receiveLine

protected java.lang.String receiveLine()
                                throws java.io.IOException

receiveFile

protected void receiveFile(java.io.OutputStream out)
                    throws java.io.IOException,
                           CVSException

receiveFile

protected void receiveFile(java.io.File fileToSaveAs)
                    throws java.io.IOException,
                           CVSException