sharpster.daemon.filemanagement
Class CVSManager

java.lang.Object
  |
  +--sharpster.daemon.filemanagement.CVSManager

public class CVSManager
extends java.lang.Object

Class which handles the local CVS and files stored in it. It should be used for executing commands to both manipulate and retrieve information, such as file logs, from the CVS. This class keeps the whole CVS database checked out under m_tempDir, where it puts recieved files before issuing an update, commit or a similar command. All methods use the method localDoCVS to perform CVS commands.


Constructor Summary
CVSManager(sharpster.daemon.filemanagement.FileMap fkm, java.lang.String tempDir)
          Constructs an instance of the class and initializes the member attributes.
 
Method Summary
 sharpster.common.ResponseCollection addFiles(sharpster.common.FileCollection files)
          Adds the files to the CVS.
 sharpster.common.ResponseCollection commitFiles(sharpster.common.FileCollection files)
          Commits the files to the CVS.
 sharpster.common.ResponseCollection cvsRun(sharpster.common.FileCollection files, java.lang.String cmd, boolean doVersions)
          Checks out the latest version of the files in files and puts it in the tempDir directory tree.
 sharpster.common.ResponseCollection localDoCVS(java.lang.String command, java.lang.String workingDirectory)
          Executes a CVS command.
 sharpster.common.ResponseCollection removeFiles(sharpster.common.FileCollection files)
          Removes the files from the CVS.
 void synchronizeCVS(sharpster.daemon.filemanagement.FileMap fileMap)
           
 sharpster.common.SharedFile translatePath(java.lang.String path)
          Translates a local file path to a path in CVS.
 sharpster.common.ResponseCollection updateFiles(sharpster.common.FileCollection files)
          Updates the given files with possible new changes from the CVS.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CVSManager

public CVSManager(sharpster.daemon.filemanagement.FileMap fkm,
                  java.lang.String tempDir)
Constructs an instance of the class and initializes the member attributes.

Method Detail

localDoCVS

public sharpster.common.ResponseCollection localDoCVS(java.lang.String command,
                                                      java.lang.String workingDirectory)
Executes a CVS command. The command attributes contains the CVS command and any arguments associated with it. If the command include adding or removing of files, this method is responsible for updating the fkm with the changes. The ResponseCollection returned by the method, holds an array of strings which contains output from the CVS command.


synchronizeCVS

public void synchronizeCVS(sharpster.daemon.filemanagement.FileMap fileMap)

cvsRun

public sharpster.common.ResponseCollection cvsRun(sharpster.common.FileCollection files,
                                                  java.lang.String cmd,
                                                  boolean doVersions)
Checks out the latest version of the files in files and puts it in the tempDir directory tree. The files objects is then completed with the checked out files.


updateFiles

public sharpster.common.ResponseCollection updateFiles(sharpster.common.FileCollection files)
Updates the given files with possible new changes from the CVS. The files in files are first stored in the accurate position in the tempDir directory tree. Then an update command is issued to the CVS. files is then updated with the updated files.


commitFiles

public sharpster.common.ResponseCollection commitFiles(sharpster.common.FileCollection files)
Commits the files to the CVS. The files in files are first stored in the tempDir directory tree, from where they are commited to the CVS.


addFiles

public sharpster.common.ResponseCollection addFiles(sharpster.common.FileCollection files)
Adds the files to the CVS. This includes also a commit of the added files. The files in files are first stored in the accurate position in the tempDir directory tree, from where the add and the commit commands are issued.


removeFiles

public sharpster.common.ResponseCollection removeFiles(sharpster.common.FileCollection files)
Removes the files from the CVS. The method is performed by removing the files specified in files in the tempDir directory tree, and then issuing CVS commands for removing the files and commiting the remove.


translatePath

public sharpster.common.SharedFile translatePath(java.lang.String path)
Translates a local file path to a path in CVS.