allensoft.javacvs.client
Class AddRequest

java.lang.Object
  |
  +--allensoft.javacvs.client.CVSCommunicationsObject
        |
        +--allensoft.javacvs.client.CVSRequest
              |
              +--allensoft.javacvs.client.MultiFileCVSRequest
                    |
                    +--allensoft.javacvs.client.AddRequest

public class AddRequest
extends MultiFileCVSRequest

Request object that adds files/directories to a repository.


Constructor Summary
AddRequest()
          Creates a new AddRequest using the default options.
AddRequest(AddOptions options)
          Creates a new AddRequest using the supplied options.
AddRequest(java.io.File file)
          Creates a new AddRequest that adds the supplied file to the repository using the default options.
AddRequest(java.io.File[] files)
          Creates a new AddRequest that adds the supplied files to the repository using the default options.
AddRequest(java.io.File[] files, AddOptions options)
          Creates a new AddRequest that adds the supplied files to the repository using the supplied options.
AddRequest(java.io.File file, AddOptions options)
          Creates a new AddRequest that adds the supplied file to the repository using the supplied options.
 
Method Summary
 KeywordSubstitutionModeClassifier getKeywordSubstitutionModeClassifier()
          Gets the KeywordSubstitutionModeClassifier used to determine the keyword substitution mode for files added.
 AddOptions getOptions()
          Gets the options used for this add request.
protected  boolean getSendQuestionableCommands()
          Overridden so we don't send questionable commands to the server for files not added.
protected  java.io.File getWorkingDirectoryForFile(java.io.File file)
          Gets the directory that corresponds to the working directory for files added to this request.
protected  CVSResponse performRequest()
          This is the main method for the request and is responsible for sending this request to the server.
 void setKeywordSubstitutionModeClassifier(KeywordSubstitutionModeClassifier classifier)
          Sets the KeywordSubstitutionModeClassifier used to determine the keyword substitution mode for files added.
 void setOptions(AddOptions options)
          Sets the options used for this add request.
protected  void validateFile(java.io.File file)
          Overridden to ensure the file is not already under CVS control (by checking if an entry exists for it in an Entries file).
 
Methods inherited from class allensoft.javacvs.client.MultiFileCVSRequest
addFile, getCurrentDirectory, getFile, getFileCount, getRepositoryLocation
 
Methods inherited from class allensoft.javacvs.client.CVSRequest
canSendIsModified, createResponse, fireStatusUpdate, getClient, getDescription, getException, getRequest, getResourceString, getResponse, hasCompletedSuccessfully, sendRequest, validateRequest, waitForSuccessfulCompletion
 
Methods inherited from class allensoft.javacvs.client.CVSCommunicationsObject
expandModules, flush, getFileFromRelativePath, getRelativePath, getRelativePath, getRelativePath, getWrapperRCSOptions, performSubRequest, receiveFile, receiveFile, receiveLine, sendArgument, sendArgument, sendArgument, sendArgument, sendCheckinProg, sendCurrentDirectory, sendDateOption, sendDirectory, sendDirectory, sendEntry, sendFileDetails, sendFileDetails, sendFileDetails, sendGlobalOption, sendKopt, sendLine, sendModified, sendOptions, sendStaticDirectory, sendSticky, sendText, sendUnchanged, sendUpdateProg, sendWorkingDirectoryDetails, sendWorkingDirectoryDetails, sendWorkingDirectoryDetails, validRequests
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddRequest

public AddRequest(java.io.File[] files,
                  AddOptions options)
           throws java.io.IOException,
                  CVSException
Creates a new AddRequest that adds the supplied files to the repository using the supplied options.

AddRequest

public AddRequest(java.io.File file,
                  AddOptions options)
           throws java.io.IOException,
                  CVSException
Creates a new AddRequest that adds the supplied file to the repository using the supplied options.

AddRequest

public AddRequest(AddOptions options)
Creates a new AddRequest using the supplied options. Files should be added to the request using the addFile method.

AddRequest

public AddRequest(java.io.File[] files)
           throws java.io.IOException,
                  CVSException
Creates a new AddRequest that adds the supplied files to the repository using the default options.

AddRequest

public AddRequest(java.io.File file)
           throws java.io.IOException,
                  CVSException
Creates a new AddRequest that adds the supplied file to the repository using the default options.

AddRequest

public AddRequest()
Creates a new AddRequest using the default options. Files should be added to the request using the addFile method.
Method Detail

getOptions

public AddOptions getOptions()
Gets the options used for this add request.

setOptions

public void setOptions(AddOptions options)
Sets the options used for this add request.

getKeywordSubstitutionModeClassifier

public KeywordSubstitutionModeClassifier getKeywordSubstitutionModeClassifier()
Gets the KeywordSubstitutionModeClassifier used to determine the keyword substitution mode for files added. By default, this is null and the substitution mode is the same for all files as defined in the AddOptions for this request. If a KeywordSubstitutionModeClassifier is set then it will override the substitution mode specified in the AddOptions.

setKeywordSubstitutionModeClassifier

public void setKeywordSubstitutionModeClassifier(KeywordSubstitutionModeClassifier classifier)
Sets the KeywordSubstitutionModeClassifier used to determine the keyword substitution mode for files added. By default, this is null and the substitution mode is the same for all files as defined in the AddOptions for this request. If a KeywordSubstitutionModeClassifier is set then it will override the substitution mode specified in the AddOptions.

getSendQuestionableCommands

protected boolean getSendQuestionableCommands()
Overridden so we don't send questionable commands to the server for files not added.
Overrides:
getSendQuestionableCommands in class CVSRequest

validateFile

protected void validateFile(java.io.File file)
                     throws java.io.IOException,
                            CVSException
Overridden to ensure the file is not already under CVS control (by checking if an entry exists for it in an Entries file).
Overrides:
validateFile in class MultiFileCVSRequest

getWorkingDirectoryForFile

protected java.io.File getWorkingDirectoryForFile(java.io.File file)
Gets the directory that corresponds to the working directory for files added to this request. This method is overridden because directories added to this request will not be working directories (because they are trying to add the directory to a repository - it is not yet a working directory). Any file added is assumed to be contained in a working directory and so this method simply returns the parent directory of the supplied file.
Overrides:
getWorkingDirectoryForFile in class MultiFileCVSRequest

performRequest

protected CVSResponse performRequest()
                              throws java.io.IOException,
                                     CVSException
Description copied from class: CVSRequest
This is the main method for the request and is responsible for sending this request to the server. The default implementation is to call sendRequest and createResponse and then call the receiveResponse method on the response object. If the request is aborted then null will be returned for the response.
Overrides:
performRequest in class CVSRequest