|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.lib.cvsclient.command.Command
org.netbeans.lib.cvsclient.command.BuildableCommand
org.netbeans.lib.cvsclient.command.BasicCommand
public abstract class BasicCommand
A class that provides common functionality for many of the CVS command that send similar sequences of requests.
Field Summary | |
---|---|
protected ClientServices |
clientServices
The client services that are provided to this command. |
protected java.io.File[] |
files
The files and/or directories to operate on. |
protected java.util.List |
requests
The requests that are sent and processed. |
Fields inherited from class org.netbeans.lib.cvsclient.command.BuildableCommand |
---|
builder |
Fields inherited from class org.netbeans.lib.cvsclient.command.Command |
---|
localDirectory |
Constructor Summary | |
---|---|
BasicCommand()
|
Method Summary | |
---|---|
protected void |
addArgumentRequest(boolean value,
java.lang.String argument)
If the specified value is true, add a ArgumentRequest for the specified argument. |
protected void |
addArgumentRequests()
Add the argument requests. |
protected void |
addDirectoryRequest(java.io.File directory)
Adds a DirectoryRequest (and maybe a StickyRequest) to the request list. |
protected void |
addRequest(Request request)
Adds the specified request to the request list. |
protected void |
addRequestForFile(java.io.File file,
Entry entry)
This method is called for each explicit file and for files within a directory. |
protected void |
addRequestForWorkingDirectory(ClientServices clientServices)
Adds the request for the current working directory. |
protected void |
addRequestsForDirectory(java.io.File directory)
Adds the appropriate requests for a given directory. |
protected void |
addRequestsForFile(java.io.File file)
Add the appropriate requests for a single file. |
protected void |
appendFileArguments(java.lang.StringBuffer buffer)
Appends the file's names to the specified buffer. |
protected boolean |
assumeLocalPathWhenUnspecified()
The result from this command is used only when the getFiles() returns null or empty array. |
protected boolean |
doesCheckFileTime()
Should return true if unchanged files should not be sent to server. |
void |
execute(ClientServices client,
EventManager em)
Execute a command. |
java.io.File |
getFileEndingWith(java.lang.String ending)
|
java.io.File[] |
getFiles()
Get the files and/or directories specified for this command to operate on. |
boolean |
getRecursive()
Deprecated. use isRecursive instead |
java.io.File |
getXthFile(int index)
Get a single file from the "files" list. |
boolean |
isRecursive()
Gets the value of the recursive option. |
protected void |
sendEntryAndModifiedRequests(Entry entry,
java.io.File file)
Send an Entry followed by a Modified or Unchanged request based on whether the file has been untouched on the local machine. |
void |
setFiles(java.io.File[] theFiles)
Set the files and/or directories on which to execute the command. |
void |
setRecursive(boolean recursive)
Sets the value of the recursive option. |
Methods inherited from class org.netbeans.lib.cvsclient.command.BuildableCommand |
---|
commandTerminated, createBuilder, isBuilderSet, messageSent, messageSent, setBuilder |
Methods inherited from class org.netbeans.lib.cvsclient.command.Command |
---|
clone, fileAdded, fileInfoGenerated, fileRemoved, fileToRemove, fileUpdated, getCVSArguments, getCVSCommand, getDisplayName, getGlobalOptions, getLocalDirectory, getLocalPath, getOptString, getRelativeToLocalPathInUnixStyle, getTrimmedString, hasFailed, moduleExpanded, resetCVSCommand, setCVSCommand, setDisplayName, setLocalDirectory |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.List requests
protected ClientServices clientServices
protected java.io.File[] files
Constructor Detail |
---|
public BasicCommand()
Method Detail |
---|
public boolean getRecursive()
public boolean isRecursive()
public void setRecursive(boolean recursive)
recursive
- true if the command should recurse, false otherwisepublic void setFiles(java.io.File[] theFiles)
null) is to use the directory in which the command was executed (see how directories are treated, below)
theFiles
- the files to operate on. May be null to indicate that the
local directory specified in the client should be used. Full, absolute
canonical pathnames must be supplied.public java.io.File[] getFiles()
public java.io.File getXthFile(int index)
index
- the index of the file in the list.public java.io.File getFileEndingWith(java.lang.String ending)
ending
- - the ending part of the file's pathname.. path separator is cvs's default '/'protected boolean doesCheckFileTime()
sendEntryAndModifiedRequests
.
protected void sendEntryAndModifiedRequests(Entry entry, java.io.File file)
entry
- the entry for the filefile
- the file in questionprotected void addRequestsForDirectory(java.io.File directory) throws java.io.IOException, CommandAbortedException
directory
- the directory to send requests for
java.io.IOException
- if an error occurs constructing the requests
CommandAbortedException
protected void addRequestForFile(java.io.File file, Entry entry)
protected void addRequestsForFile(java.io.File file) throws java.io.IOException
file
- the file to send requests for
java.io.IOException
- if an error occurs constructing the requestsprotected final void addDirectoryRequest(java.io.File directory)
protected void addArgumentRequests()
public void execute(ClientServices client, EventManager em) throws CommandException, AuthenticationException
update,
statusetc.)
execute
in class BuildableCommand
client
- the client services object that provides any necessary
services to this command, including the ability to actually process
all the requests
CommandException
- if an error occurs executing the command
AuthenticationException
protected boolean assumeLocalPathWhenUnspecified()
protected final void addRequest(Request request)
protected final void addRequestForWorkingDirectory(ClientServices clientServices) throws java.io.IOException
java.io.IOException
protected final void addArgumentRequest(boolean value, java.lang.String argument)
protected final void appendFileArguments(java.lang.StringBuffer buffer)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |