| java.lang.Object org.netbeans.lib.cvsclient.command.Command org.netbeans.lib.cvsclient.command.BuildableCommand org.netbeans.lib.cvsclient.command.BasicCommand
All known Subclasses: org.netbeans.lib.cvsclient.command.annotate.RannotateCommand, org.netbeans.lib.cvsclient.command.diff.DiffCommand, org.netbeans.lib.cvsclient.command.watchers.WatchersCommand, org.netbeans.lib.cvsclient.command.edit.EditCommand, org.netbeans.lib.cvsclient.command.unedit.UneditCommand, org.netbeans.lib.cvsclient.command.annotate.AnnotateCommand, org.netbeans.lib.cvsclient.command.commit.CommitCommand, org.netbeans.lib.cvsclient.command.tag.TagCommand, org.netbeans.lib.cvsclient.command.watch.WatchCommand, org.netbeans.lib.cvsclient.command.status.StatusCommand, org.netbeans.lib.cvsclient.command.log.LogCommand, org.netbeans.lib.cvsclient.command.remove.RemoveCommand, org.netbeans.lib.cvsclient.command.checkout.CheckoutCommand, org.netbeans.lib.cvsclient.command.update.UpdateCommand, org.netbeans.lib.cvsclient.command.log.RlogCommand, org.netbeans.lib.cvsclient.command.editors.EditorsCommand,
BasicCommand | abstract public class BasicCommand extends BuildableCommand (Code) | | A class that provides common functionality for many of the CVS command
that send similar sequences of requests.
author: Robert Greig |
Method Summary | |
final protected void | addArgumentRequest(boolean value, String argument) If the specified value is true, add a ArgumentRequest for the specified
argument. | protected void | addArgumentRequests() Add the argument requests. | final protected void | addDirectoryRequest(File directory) Adds a DirectoryRequest (and maybe a StickyRequest) to the request list. | final protected void | addRequest(Request request) Adds the specified request to the request list. | protected void | addRequestForFile(File file, Entry entry) This method is called for each explicit file and for files within a
directory. | final protected void | addRequestForWorkingDirectory(ClientServices clientServices) Adds the request for the current working directory. | protected void | addRequestsForDirectory(File directory) Adds the appropriate requests for a given directory. | protected void | addRequestsForFile(File file) Add the appropriate requests for a single file. | final protected void | appendFileArguments(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.
in such a case and when this method returns true, it is assumed the localpath should be taken
as the 'default' file for the building of requests.
Generally assumed to be true. | protected boolean | doesCheckFileTime() Should return true if unchanged files should not be sent to server. | public void | execute(ClientServices client, EventManager em) Execute a command. | public File | getFileEndingWith(String ending) Parameters: ending - - the ending part of the file's pathname.. | public File[] | getFiles() Get the files and/or directories specified for this command to operate
on. | public boolean | getRecursive() Gets the value of the recursive option. | public File | getXthFile(int index) Get a single file from the "files" list. | public boolean | isRecursive() Gets the value of the recursive option. | protected void | sendEntryAndModifiedRequests(Entry entry, File file) Send an Entry followed by a Modified or Unchanged request based on
whether the file has been untouched on the local machine. | public void | setFiles(File[] theFiles) Set the files and/or directories on which to execute the command.
The way these are processed is:
| public void | setRecursive(boolean recursive) Sets the value of the recursive option. |
clientServices | protected ClientServices clientServices(Code) | | The client services that are provided to this command.
|
files | protected File[] files(Code) | | The files and/or directories to operate on.
|
requests | protected List requests(Code) | | The requests that are sent and processed.
|
addArgumentRequest | final protected void addArgumentRequest(boolean value, String argument)(Code) | | If the specified value is true, add a ArgumentRequest for the specified
argument.
|
addArgumentRequests | protected void addArgumentRequests()(Code) | | Add the argument requests. The argument requests are created using
the original set of files/directories passed in. Subclasses of this
class should call this method at the appropriate point in their
execute() method. Note that arguments are appended to the list.
|
addDirectoryRequest | final protected void addDirectoryRequest(File directory)(Code) | | Adds a DirectoryRequest (and maybe a StickyRequest) to the request list.
|
addRequest | final protected void addRequest(Request request)(Code) | | Adds the specified request to the request list.
|
addRequestForFile | protected void addRequestForFile(File file, Entry entry)(Code) | | This method is called for each explicit file and for files within a
directory.
|
addRequestForWorkingDirectory | final protected void addRequestForWorkingDirectory(ClientServices clientServices) throws IOException(Code) | | Adds the request for the current working directory.
|
addRequestsForDirectory | protected void addRequestsForDirectory(File directory) throws IOException, CommandAbortedException(Code) | | Adds the appropriate requests for a given directory. Sends a
directory request followed by as many Entry and Modified requests
as required
Parameters: directory - the directory to send requests for throws: IOException - if an error occurs constructing the requests |
addRequestsForFile | protected void addRequestsForFile(File file) throws IOException(Code) | | Add the appropriate requests for a single file. A directory request
is sent, followed by an Entry and Modified request
Parameters: file - the file to send requests for throws: IOException - if an error occurs constructing the requests |
appendFileArguments | final protected void appendFileArguments(StringBuffer buffer)(Code) | | Appends the file's names to the specified buffer.
|
assumeLocalPathWhenUnspecified | protected boolean assumeLocalPathWhenUnspecified()(Code) | | The result from this command is used only when the getFiles() returns null or empty array.
in such a case and when this method returns true, it is assumed the localpath should be taken
as the 'default' file for the building of requests.
Generally assumed to be true. Can be overriden by subclasses. However make sure you know what you are doing. :)
|
doesCheckFileTime | protected boolean doesCheckFileTime()(Code) | | Should return true if unchanged files should not be sent to server.
If false is returned, all files will be sent to server
This method is used by sendEntryAndModifiedRequests .
|
execute | public void execute(ClientServices client, EventManager em) throws CommandException, AuthenticationException(Code) | | Execute a command. This implementation sends a Root request, followed
by as many Directory and Entry requests as is required by the recurse
setting and the file arguments that have been set. Subclasses should
call this first, and tag on the end of the requests list any further
requests and, finally, the actually request that does the command (e.g.
update , status etc.)
Parameters: client - the client services object that provides any necessaryservices to this command, including the ability to actually processall the requests throws: CommandException - if an error occurs executing the command |
getFileEndingWith | public File getFileEndingWith(String ending)(Code) | | Parameters: ending - - the ending part of the file's pathname.. path separator is cvs's default '/' |
getFiles | public File[] getFiles()(Code) | | Get the files and/or directories specified for this command to operate
on.
the array of Files |
getRecursive | public boolean getRecursive()(Code) | | Gets the value of the recursive option.
true if recursive, false if not |
getXthFile | public File getXthFile(int index)(Code) | | Get a single file from the "files" list. returns only files, not directories.
This method is used from within the builders, because for single file requests, the
cvs server doesn't return us enough information to identify what file has been returned.
Thus we sort the "files" array (files come before directories. Then the response froms erver comes in the same order
and the files can be found this way.
Parameters: index - the index of the file in the list. |
isRecursive | public boolean isRecursive()(Code) | | Gets the value of the recursive option.
true if recursive, false if not |
sendEntryAndModifiedRequests | protected void sendEntryAndModifiedRequests(Entry entry, File file)(Code) | | Send an Entry followed by a Modified or Unchanged request based on
whether the file has been untouched on the local machine.
Parameters: entry - the entry for the file Parameters: file - the file in question |
setFiles | public void setFiles(File[] theFiles)(Code) | | Set the files and/or directories on which to execute the command.
The way these are processed is:
- Default action (i.e. not setting the files explicitly or
setting them to
null ) is to use the directory in which
the command was executed (see how directories are treated, below)
- Files are handled how you would expect
- For directories, all files within the directory are sent
Parameters: theFiles - the files to operate on. May be null to indicate that thelocal directory specified in the client should be used. Full, absolutecanonical pathnames must be supplied. |
setRecursive | public void setRecursive(boolean recursive)(Code) | | Sets the value of the recursive option.
Parameters: recursive - true if the command should recurse, false otherwise |
Fields inherited from org.netbeans.lib.cvsclient.command.Command | protected String localDirectory(Code)(Java Doc)
|
|
|