for his original
attempt at the integration of MindBright's SSH package into this
client. The effort was most helpful in understanding the package.
- Version:
- $Revision: 2.20 $
- Author:
- Timothy Gerard Endres, time@ice.com.
- See Also:
CVSRequest
,
CVSResponse
,
CVSProject
Constructor Summary |
CVSClient()
Creates a CVS client. |
CVSClient(java.lang.String hostName,
int port)
Creates a CVS client using the provided hostname and port number. |
Method Summary |
CVSResponse |
buildErrorResponse(CVSRequest request,
CVSResponse response,
java.lang.String message)
|
boolean |
checkForCancel(CVSResponse response)
|
boolean |
closeServer()
|
java.lang.String |
generateTempPath()
|
java.lang.String |
getHostName()
Returns the hostname of the cvs server. |
boolean |
getMultipleInterfaceSupport()
Returns the port number of the cvs server. |
int |
getPort()
Returns the port number of the cvs server. |
java.lang.String |
getReason()
Returns the reason for the last error. |
java.lang.String |
getStickTag(CVSRequest request,
java.lang.String localDir)
|
java.lang.String |
getTempDirectory()
Returns the pathname of the directory in which temporary files are created. |
boolean |
isCanceled()
|
boolean |
isServerOpen()
Indicates whether or not the connection to the server is established. |
boolean |
performLogin(CVSRequest request)
|
boolean |
performRSHProtocol(java.lang.String remoteUserName,
java.lang.String serverCommand)
|
CVSResponse |
processCVSRequest(CVSRequest request)
This method is the heart of the CVSClient class. |
CVSResponse |
processCVSRequest(CVSRequest request,
CVSResponse response)
|
CVSResponse |
readAndParseResponse(CVSRequest request,
CVSResponse response)
|
java.lang.String |
readAsciiLine(java.io.Reader in)
|
java.lang.String |
readLine()
|
java.lang.String |
readResponse()
|
boolean |
requestValidRequests(CVSRequest request)
|
boolean |
retrieveFile(CVSResponseItem item,
java.io.File file)
|
boolean |
sendArguments(CVSArgumentVector arguments)
|
boolean |
sendCVSArgument(java.lang.String argument)
|
boolean |
sendCVSEntries(CVSRequest request)
|
boolean |
sendCVSEntry(CVSRequest request,
CVSEntry entry,
java.io.File entryFile)
|
boolean |
sendCVSModule(CVSRequest request)
|
boolean |
sendCVSRootDirectory(CVSRequest request)
|
boolean |
sendEntriesArguments(CVSRequest request)
|
boolean |
sendEntryRepository(CVSRequest request,
CVSEntry entry)
This method is used to send the 'Directory' command before
an entry is sent, to set the "context" of the entry (i.e.,
the entry's directory). |
boolean |
sendFileAscii(CVSEntry entry,
java.io.File entryFile,
boolean gzipFileMode)
|
boolean |
sendFileContents(java.io.InputStream in)
|
boolean |
sendFileRaw(CVSEntry entry,
java.io.File entryFile,
boolean useGzipFile)
|
boolean |
sendGlobalArguments(CVSArgumentVector arguments)
|
boolean |
sendLine(java.lang.String line)
|
boolean |
sendLostEntry(CVSRequest request,
CVSEntry entry,
boolean useUnchanged)
|
boolean |
sendModified(CVSRequest request,
CVSEntry entry,
java.io.File entryFile,
boolean empty,
int trans)
|
boolean |
sendNotifies(CVSRequest request)
|
boolean |
sendRootRepository(CVSRequest request)
Send the "root" of our repository. |
boolean |
sendSetVariables(CVSRequest request)
|
boolean |
sendStatic(CVSRequest request,
CVSEntry entry)
|
boolean |
sendSticky(CVSRequest request,
CVSEntry entry)
|
boolean |
sendSticky(CVSRequest request,
java.lang.String localDir)
|
boolean |
sendString(java.lang.String string)
|
boolean |
sendUnchangedEntry(CVSRequest request,
CVSEntry entry,
boolean useUnchanged)
|
boolean |
sendValidResponses(CVSRequest request,
java.lang.String additional)
|
void |
setCanceled(boolean can)
|
void |
setHostName(java.lang.String hostName)
Sets the hostname of the cvs server. |
void |
setMultipleInterfaceSupport(boolean flag)
Sets the port number of the cvs server. |
void |
setPort(int port)
Sets the port number of the cvs server. |
void |
setReason(java.lang.String reason)
Sets the resaon for the last error. |
void |
setTempDirectory(java.lang.String tempPath)
Sets the pathname of the directory in which temporary files are created. |
boolean |
verifyHost(java.lang.String host,
com.sshtools.j2ssh.transport.publickey.SshPublicKey pk)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RCS_ID
public static final java.lang.String RCS_ID
- See Also:
- Constant Field Values
RCS_REV
public static final java.lang.String RCS_REV
- See Also:
- Constant Field Values
DEFAULT_SSH_PORT
public static final int DEFAULT_SSH_PORT
- See Also:
- Constant Field Values
DEFAULT_RSH_PORT
public static final int DEFAULT_RSH_PORT
- See Also:
- Constant Field Values
DEFAULT_CVS_PORT
public static final int DEFAULT_CVS_PORT
- See Also:
- Constant Field Values
DEFAULT_DIR_PORT
public static final int DEFAULT_DIR_PORT
- See Also:
- Constant Field Values
DEFAULT_TEMP_PATH
public static final java.lang.String DEFAULT_TEMP_PATH
- See Also:
- Constant Field Values
TRANSLATE_NONE
public static final int TRANSLATE_NONE
- Used to indicate that an ascii file is being transferred.
- See Also:
- Constant Field Values
TRANSLATE_ASCII
public static final int TRANSLATE_ASCII
- Used to indicate that a binary file is being transferred.
- See Also:
- Constant Field Values
CVSClient
public CVSClient()
- Creates a CVS client.
The client is unusable, however, until
the hostname and port number are established.
CVSClient
public CVSClient(java.lang.String hostName,
int port)
- Creates a CVS client using the provided hostname and port number.
- Parameters:
hostName
- The hostname of the cvs server.port
- The port number of the cvs server (typically 2401).
getHostName
public java.lang.String getHostName()
- Returns the hostname of the cvs server.
setHostName
public void setHostName(java.lang.String hostName)
- Sets the hostname of the cvs server.
- Parameters:
hostName
- The hostname of the cvs server.
getPort
public int getPort()
- Returns the port number of the cvs server.
setPort
public void setPort(int port)
- Sets the port number of the cvs server.
- Parameters:
port
- The port number of the cvs server (typically 2401).
getMultipleInterfaceSupport
public boolean getMultipleInterfaceSupport()
- Returns the port number of the cvs server.
setMultipleInterfaceSupport
public void setMultipleInterfaceSupport(boolean flag)
- Sets the port number of the cvs server.
getTempDirectory
public java.lang.String getTempDirectory()
- Returns the pathname of the directory in which temporary files are created.
setTempDirectory
public void setTempDirectory(java.lang.String tempPath)
- Sets the pathname of the directory in which temporary files are created.
- Parameters:
tempPath
- The full pathname of the temporary directory.
getReason
public java.lang.String getReason()
- Returns the reason for the last error.
setReason
public void setReason(java.lang.String reason)
- Sets the resaon for the last error.
- Parameters:
reason
- The string describing the reason.
isServerOpen
public boolean isServerOpen()
- Indicates whether or not the connection to the server is established.
sendCVSRootDirectory
public boolean sendCVSRootDirectory(CVSRequest request)
sendRootRepository
public boolean sendRootRepository(CVSRequest request)
- Send the "root" of our repository. Since all of our commands
now work with the assumption that everything is relative to
"./", we need to properly establish 'Directory .' for the
module that we are working with.
sendEntryRepository
public boolean sendEntryRepository(CVSRequest request,
CVSEntry entry)
- This method is used to send the 'Directory' command before
an entry is sent, to set the "context" of the entry (i.e.,
the entry's directory).
Note that jCVS has a peculiarity. We only
send the entries the user has selected in many cases. Thus,
if we refer to a file 'com/ice/cvsc/CVSLog.java', we send
that 'Directory' command, but none for the directories 'com',
and 'ice'. In most cases, this is not an issue, but for a top
level command like Update, this causes entire branches of the
project hierarchy to be skipped because we had not sent the
'Directory' command for that level. To solve this, whenever
we send a 'Directory' command, we send all of the intermediate
levels as well. In order to minimize the redundancy, we keep
a list of what has already been sent in 'this.dirHash'.
- Parameters:
request
- The current request.entry
- The entry for which to send the command.
- Returns:
- True if successful, else failure.
sendCVSArgument
public boolean sendCVSArgument(java.lang.String argument)
sendCVSModule
public boolean sendCVSModule(CVSRequest request)
sendSetVariables
public boolean sendSetVariables(CVSRequest request)
sendModified
public boolean sendModified(CVSRequest request,
CVSEntry entry,
java.io.File entryFile,
boolean empty,
int trans)
sendLostEntry
public boolean sendLostEntry(CVSRequest request,
CVSEntry entry,
boolean useUnchanged)
sendUnchangedEntry
public boolean sendUnchangedEntry(CVSRequest request,
CVSEntry entry,
boolean useUnchanged)
sendCVSEntry
public boolean sendCVSEntry(CVSRequest request,
CVSEntry entry,
java.io.File entryFile)
sendCVSEntries
public boolean sendCVSEntries(CVSRequest request)
getStickTag
public java.lang.String getStickTag(CVSRequest request,
java.lang.String localDir)
sendSticky
public boolean sendSticky(CVSRequest request,
CVSEntry entry)
sendSticky
public boolean sendSticky(CVSRequest request,
java.lang.String localDir)
sendStatic
public boolean sendStatic(CVSRequest request,
CVSEntry entry)
sendGlobalArguments
public boolean sendGlobalArguments(CVSArgumentVector arguments)
sendArguments
public boolean sendArguments(CVSArgumentVector arguments)
sendEntriesArguments
public boolean sendEntriesArguments(CVSRequest request)
sendNotifies
public boolean sendNotifies(CVSRequest request)
buildErrorResponse
public CVSResponse buildErrorResponse(CVSRequest request,
CVSResponse response,
java.lang.String message)
performLogin
public boolean performLogin(CVSRequest request)
requestValidRequests
public boolean requestValidRequests(CVSRequest request)
processCVSRequest
public CVSResponse processCVSRequest(CVSRequest request)
- This method is the heart of the CVSClient class.
Given a CVSRequest, this method will perform all of the
processing required to open the connection, authenticate,
send all requests, read all responses, and package the
responses into a CVSResponse object, which is returned
as the result of this method. The result is guaranteed
to not be null, and will have its status set to indicate
the status of the reuest. The resulting response object
should be handed into the CVSProject's processCVSResponse()
method to process the server's reponses on the local
project contents.
- Parameters:
request
- The CVSRequest describing our request.
isCanceled
public boolean isCanceled()
setCanceled
public void setCanceled(boolean can)
checkForCancel
public boolean checkForCancel(CVSResponse response)
processCVSRequest
public CVSResponse processCVSRequest(CVSRequest request,
CVSResponse response)
generateTempPath
public java.lang.String generateTempPath()
readAndParseResponse
public CVSResponse readAndParseResponse(CVSRequest request,
CVSResponse response)
retrieveFile
public boolean retrieveFile(CVSResponseItem item,
java.io.File file)
sendFileContents
public boolean sendFileContents(java.io.InputStream in)
sendFileRaw
public boolean sendFileRaw(CVSEntry entry,
java.io.File entryFile,
boolean useGzipFile)
sendFileAscii
public boolean sendFileAscii(CVSEntry entry,
java.io.File entryFile,
boolean gzipFileMode)
readAsciiLine
public java.lang.String readAsciiLine(java.io.Reader in)
sendValidResponses
public boolean sendValidResponses(CVSRequest request,
java.lang.String additional)
sendString
public boolean sendString(java.lang.String string)
sendLine
public boolean sendLine(java.lang.String line)
readLine
public java.lang.String readLine()
readResponse
public java.lang.String readResponse()
verifyHost
public boolean verifyHost(java.lang.String host,
com.sshtools.j2ssh.transport.publickey.SshPublicKey pk)
throws com.sshtools.j2ssh.transport.TransportProtocolException
- Specified by:
verifyHost
in interface com.sshtools.j2ssh.transport.HostKeyVerification
com.sshtools.j2ssh.transport.TransportProtocolException
performRSHProtocol
public boolean performRSHProtocol(java.lang.String remoteUserName,
java.lang.String serverCommand)
closeServer
public boolean closeServer()
Copyright © 1997-2003, Timothy G. Endres, All Rights Reserved.