| java.lang.Object org.w3c.cvs.CvsRunner
CvsRunner | class CvsRunner implements CVS(Code) | | |
Field Summary | |
public static boolean | debug |
Method Summary | |
void | cvsAdd(CvsDirectory cvs, String names) | void | cvsAdd(CvsDirectory cvs, String names, String env) | void | cvsAdmin(CvsDirectory cvs, String command) | void | cvsCommit(CvsDirectory cvs, String names, String comment, CommitHandler handler) Run the commit command on the given set of files. | void | cvsCommit(CvsDirectory cvs, String names, String comment, CommitHandler handler, String env) Run the commit command on the given set of files. | void | cvsCommit(CvsDirectory cvs, String msg, CommitHandler handler) Ru the commit comamnd in the given directory. | void | cvsCommit(CvsDirectory cvs, String msg, CommitHandler handler, String env) Ru the commit comamnd in the given directory. | String | cvsDiff(CvsDirectory cvs, String name) Run the diff command on the given file
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: name - The name of the file to diff. exception: CvsException - If the CVS command failed. | void | cvsGet(CvsDirectory cvs, String path) | void | cvsLoad(CvsDirectory cvs, String filename, UpdateHandler handler) Check this file status. | void | cvsLoad(CvsDirectory cvs, String filename, UpdateHandler handler, StatusHandler statush) Check this file status. | void | cvsLoad(CvsDirectory cvs, UpdateHandler handler, StatusHandler statush) Check all this directory files status. | String | cvsLog(CvsDirectory cvs, String name) Run the log command on the given file
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: name - The name of the file to log. exception: CvsException - If the CVS command failed. | void | cvsRemove(CvsDirectory cvs, String names) Run the remove command. | void | cvsRevert(CvsDirectory cvs, String name, String revision, OutputStream out, String env) Run the 'update -p -r ' command. | void | cvsRevert(CvsDirectory cvs, String name, String revision, File file, String env) Run the 'update -p -r ' command. | void | cvsStatus(CvsDirectory cvs, String filename, StatusHandler statush) Check this directory file status. | void | cvsUpdate(CvsDirectory cvs, String names, UpdateHandler handler) Run the update command. | void | cvsUpdate(CvsDirectory cvs, UpdateHandler handler) Run the update command on the whole directory. | void | cvsUpdateDirectory(CvsDirectory cvs, File subdir, UpdateHandler handler) Update a directory. | protected void | error(String mth, String msg) Emit an error. | protected String[] | getCommand(CvsDirectory cvs, String cvsopts, String cmdopts) Get the CVS command String array.
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: cvsopts - The CVS wide options. Parameters: cmdopts - The command, and its optional options. | protected String | getQuotedFilename(String line) Get a filename between quote contained in this String. | File | getTemporaryFile(String string) Dump the given string into a temporary file. | protected StringBuffer | readError(InputStream procin, StringBuffer into) Parse the error message and throw an exception if necessary. | protected Process | runCvsProcess(String args) Run a cvs command, return the process object. | protected Process | runCvsProcess(String args, String env) Run a cvs command, return the process object. | protected synchronized void | waitForCompletion(Process proc, boolean ccode) Wait for the underlying CVS process to finish. |
debug | public static boolean debug(Code) | | |
cvsAdd | void cvsAdd(CvsDirectory cvs, String names) throws CvsException(Code) | | Run the add command
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: names - The name of the files to add locally. exception: CvsException - If the CVS command failed. |
cvsAdd | void cvsAdd(CvsDirectory cvs, String names, String env) throws CvsException(Code) | | Run the add command
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: names - The name of the files to add locally. Parameters: env - The extra env to use during the process. exception: CvsException - If the CVS command failed. |
cvsAdmin | void cvsAdmin(CvsDirectory cvs, String command) throws CvsException(Code) | | Run the admin command
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: command - The rcs command exception: CvsException - If the CVS command failed. |
cvsCommit | void cvsCommit(CvsDirectory cvs, String names, String comment, CommitHandler handler) throws CvsException(Code) | | Run the commit command on the given set of files.
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: names - The name of files to commit. Parameters: comment - Description of the file changes. Parameters: handler - The CVS output callback. exception: CvsException - If the CVS process failed. |
cvsCommit | void cvsCommit(CvsDirectory cvs, String names, String comment, CommitHandler handler, String env) throws CvsException(Code) | | Run the commit command on the given set of files.
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: names - The name of files to commit. Parameters: comment - Description of the file changes. Parameters: handler - The CVS output callback. Parameters: env - The extra env to use during commit. exception: CvsException - If the CVS process failed. |
cvsCommit | void cvsCommit(CvsDirectory cvs, String msg, CommitHandler handler) throws CvsException(Code) | | Ru the commit comamnd in the given directory.
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: msg - Description of directory changes since last commit. Parameters: handler - The CVS output callback. exception: CvsException - If the CVS process failed. |
cvsCommit | void cvsCommit(CvsDirectory cvs, String msg, CommitHandler handler, String env) throws CvsException(Code) | | Ru the commit comamnd in the given directory.
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: msg - Description of directory changes since last commit. Parameters: handler - The CVS output callback. Parameters: env - The extra env to use during commit. exception: CvsException - If the CVS process failed. |
cvsDiff | String cvsDiff(CvsDirectory cvs, String name) throws CvsException(Code) | | Run the diff command on the given file
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: name - The name of the file to diff. exception: CvsException - If the CVS command failed. A String containing the diff, or null if thefile is in sync with the repository. |
cvsLoad | void cvsLoad(CvsDirectory cvs, String filename, UpdateHandler handler) throws CvsException(Code) | | Check this file status.
We just run the update command with the -n toggle.
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: handler - The underlying update handler callback. exception: CvsException - If the CVS process failed. |
cvsLoad | void cvsLoad(CvsDirectory cvs, String filename, UpdateHandler handler, StatusHandler statush) throws CvsException(Code) | | Check this file status.
We just run the update command and the status with the -n toggle.
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: handler - The underlying update handler callback. Parameters: statush - The underlying status handler callback. exception: CvsException - If the CVS process failed. |
cvsLoad | void cvsLoad(CvsDirectory cvs, UpdateHandler handler, StatusHandler statush) throws CvsException(Code) | | Check all this directory files status.
We just run the update command and the status with the -n toggle.
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: handler - The underlying update handler callback. Parameters: statush - The underlying status handler callback. exception: CvsException - If the CVS process failed. |
cvsLog | String cvsLog(CvsDirectory cvs, String name) throws CvsException(Code) | | Run the log command on the given file
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: name - The name of the file to log. exception: CvsException - If the CVS command failed. A String containing the file's log. |
cvsRemove | void cvsRemove(CvsDirectory cvs, String names) throws CvsException(Code) | | Run the remove command.
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: names - The name of the files to remove locally. exception: CvsException - If the CVS command failed. |
cvsRevert | void cvsRevert(CvsDirectory cvs, String name, String revision, OutputStream out, String env) throws CvsException(Code) | | Run the 'update -p -r ' command.
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: name - The file name to which the update command applies. Parameters: revision - The revision to retrieve Parameters: out - The OutputStream exception: CvsException - If the underlying CVS process fails |
cvsRevert | void cvsRevert(CvsDirectory cvs, String name, String revision, File file, String env) throws CvsException(Code) | | Run the 'update -p -r ' command.
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: name - The file name to which the update command applies. Parameters: revision - The revision to retrieve Parameters: file - The local file exception: CvsException - If the underlying CVS process fails |
cvsStatus | void cvsStatus(CvsDirectory cvs, String filename, StatusHandler statush) throws CvsException(Code) | | Check this directory file status.
We just run the update command with the -n toggle.
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: statush - The underlying status handler callback. exception: CvsException - If the CVS process failed. |
cvsUpdate | void cvsUpdate(CvsDirectory cvs, UpdateHandler handler) throws CvsException(Code) | | Run the update command on the whole directory. (not recursivly)
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: handler - The CVS output handler. exception: CvsException - If something failed. |
cvsUpdateDirectory | void cvsUpdateDirectory(CvsDirectory cvs, File subdir, UpdateHandler handler) throws CvsException(Code) | | Update a directory.
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: subdir - The sub-directory of the above that needs to be updated. Parameters: handler - The CVS output handler. exception: CvsException - If the CVS process fails. |
error | protected void error(String mth, String msg) throws CvsException(Code) | | Emit an error.
Some abnormal situation occured, emit an error message.
Parameters: mth - The method in which the error occured. Parameters: msg - The message to emit. exception: CvsException - The exception that will be thrown as a result of the error. |
getCommand | protected String[] getCommand(CvsDirectory cvs, String cvsopts, String cmdopts)(Code) | | Get the CVS command String array.
Parameters: cvs - The target CvsDirectory in which the command is to be run. Parameters: cvsopts - The CVS wide options. Parameters: cmdopts - The command, and its optional options. A String array, giving the command to be executed. |
getQuotedFilename | protected String getQuotedFilename(String line)(Code) | | Get a filename between quote contained in this String.
the filename of null. |
getTemporaryFile | File getTemporaryFile(String string) throws CvsException(Code) | | Dump the given string into a temporary file.
This is used for th -f argument of the cvs commit command.
This method should only be used from a synchronized method.
Parameters: string - The string to dump. |
runCvsProcess | protected Process runCvsProcess(String args) throws IOException(Code) | | Run a cvs command, return the process object.
Parameters: args - The command to run. exception: IOException - If the process couldn't be launched. |
runCvsProcess | protected Process runCvsProcess(String args, String env) throws IOException(Code) | | Run a cvs command, return the process object.
Parameters: args - The command to run. Parameters: env - The extra environment. exception: IOException - If the process couldn't be launched. |
waitForCompletion | protected synchronized void waitForCompletion(Process proc, boolean ccode) throws CvsException(Code) | | Wait for the underlying CVS process to finish.
Once the process is terminated, all relevant streams are closed, and
an exception if potentially thrown if the process indicated failure.
Parameters: proc - The CVS process. Parameters: ccode - Should we expect a zero status from the child process. exception: CvsException - If a zero status is expected, and the CVSprocess exit status is not zero. |
|
|