Cvs (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs, class: Cvs

# Class Cvs

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.AbstractCvsTask
org.apache.tools.ant.taskdefs.Cvs

All Implemented Interfaces:
  `Cloneable`

public class Cvs extends AbstractCvsTask
Performs operations on a CVS repository. original 1.20 NOTE: This implementation has been moved to AbstractCvsTask with the addition of some accessors for extensibility.

Since:
  Ant 1.1

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class AbstractCvsTask

  `AbstractCvsTask.Module`
  Modifier and Type
  Class
  Description
  `static final class`
  `AbstractCvsTask.Module`

- ## Field Summary

  ### Fields inherited from class AbstractCvsTask

  `DEFAULT_COMPRESSION_LEVEL`
  Modifier and Type
  Field
  Description
  `static final int`
  `DEFAULT_COMPRESSION_LEVEL`
  Default compression level to use, if compression is enabled via setCompression(true).

  ### Fields inherited from class Task

  `target, taskName, taskType, wrapper`
  Modifier and Type
  Field
  Description
  `protected Target`
  `target`
  Deprecated.
  since 1.6.x.
  `protected String`
  `taskName`
  Deprecated.
  since 1.6.x.
  `protected String`
  `taskType`
  Deprecated.
  since 1.6.x.
  `protected RuntimeConfigurable`
  `wrapper`
  Deprecated.
  since 1.6.x.

  ### Fields inherited from class ProjectComponent

  `description, location, project`
  Modifier and Type
  Field
  Description
  `protected String`
  `description`
  Deprecated.
  since 1.6.x.
  `protected Location`
  `location`
  Deprecated.
  since 1.6.x.
  `protected Project`
  `project`
  Deprecated.
  since 1.6.x.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Cvs()`
  CVS Task - now implemented by the Abstract CVS Task base class

- ## Method Summary

  ### Methods inherited from class AbstractCvsTask

  `addCommandArgument, addCommandArgument, addConfiguredCommandline, addConfiguredCommandline, addModule, configureCommandline, execute, getCommand, getCvsRoot, getCvsRsh, getDest, getErrorStream, getExecuteStreamHandler, getModules, getOutputStream, getPackage, getPassFile, getPort, getTag, removeCommandline, runCommand, setAppend, setCommand, setCompression, setCompressionLevel, setCvsRoot, setCvsRsh, setDate, setDest, setError, setErrorStream, setExecuteStreamHandler, setFailOnError, setNoexec, setOutput, setOutputStream, setPackage, setPassfile, setPort, setQuiet, setReallyquiet, setTag`
  Modifier and Type
  Method
  Description
  `void`
  `addCommandArgument(String arg)`
  This needs to be public to allow configuration of commands externally.
  `void`
  `addCommandArgument(Commandline c, String arg)`
  This method adds a command line argument to an external command.
  `void`
  `addConfiguredCommandline(Commandline c)`
  Adds direct command-line to execute.
  `void`
  `addConfiguredCommandline(Commandline c, boolean insertAtStart)`
  Configures and adds the given Commandline.
  `void`
  `addModule(AbstractCvsTask.Module m)`
  add a named module/package.
  `protected void`
  `configureCommandline(Commandline c)`
  Configure a commandline element for things like cvsRoot, quiet, etc.
  `void`
  `execute()`
  do the work
  `String`
  `getCommand()`
  accessor to a command line as string This should be deprecated AntoineLL July 23d 2003
  `String`
  `getCvsRoot()`
  access the CVSROOT variable
  `String`
  `getCvsRsh()`
  access the CVS_RSH variable
  `File`
  `getDest()`
  get the file where the checked out files should be placed
  `protected OutputStream`
  `getErrorStream()`
  access the stream to which the stderr from cvs should go if this stream has already been set, it will be returned if the stream has not yet been set, if the attribute error has been set, the output stream will go to the file denoted by the error attribute otherwise the stderr output will go to ant's logging system
  `protected ExecuteStreamHandler`
  `getExecuteStreamHandler()`
  find the handler and instantiate it if it does not exist yet
  `protected List<AbstractCvsTask.Module>`
  `getModules()`
  `protected OutputStream`
  `getOutputStream()`
  access the stream to which the stdout from cvs should go if this stream has already been set, it will be returned if the stream has not yet been set, if the attribute output has been set, the output stream will go to the output file otherwise the output will go to ant's logging system
  `String`
  `getPackage()`
  access the package or module to operate upon
  `File`
  `getPassFile()`
  find the password file
  `int`
  `getPort()`
  access the port of CVS
  `String`
  `getTag()`
  tag or branch
  `protected void`
  `removeCommandline(Commandline c)`
  remove a particular command from a vector of command lines
  `protected void`
  `runCommand(Commandline toExecute)`
  Sets up the environment for toExecute and then runs it.
  `void`
  `setAppend(boolean value)`
  Whether to append output/error when redirecting to a file.
  `void`
  `setCommand(String c)`
  The CVS command to execute.
  `void`
  `setCompression(boolean usecomp)`
  If true, this is the same as compressionlevel="3".
  `void`
  `setCompressionLevel(int level)`
  If set to a value 1-9 it adds -zN to the cvs command line, else it disables compression.
  `void`
  `setCvsRoot(String root)`
  The CVSROOT variable.
  `void`
  `setCvsRsh(String rsh)`
  The CVS_RSH variable.
  `void`
  `setDate(String p)`
  Use the most recent revision no later than the given date.
  `void`
  `setDest(File dest)`
  The directory where the checked out files should be placed.
  `void`
  `setError(File error)`
  The file to direct standard error from the command.
  `protected void`
  `setErrorStream(OutputStream errorStream)`
  sets a stream to which the stderr from the cvs exe should go
  `void`
  `setExecuteStreamHandler(ExecuteStreamHandler handler)`
  sets the handler
  `void`
  `setFailOnError(boolean failOnError)`
  Stop the build process if the command exits with a return code other than 0.
  `void`
  `setNoexec(boolean ne)`
  If true, report only and don't change any files.
  `void`
  `setOutput(File output)`
  The file to direct standard output from the command.
  `protected void`
  `setOutputStream(OutputStream outputStream)`
  sets a stream to which the output from the cvs executable should be sent
  `void`
  `setPackage(String p)`
  The package/module to operate upon.
  `void`
  `setPassfile(File passFile)`
  Password file to read passwords from.
  `void`
  `setPort(int port)`
  Port used by CVS to communicate with the server.
  `void`
  `setQuiet(boolean q)`
  If true, suppress informational messages.
  `void`
  `setReallyquiet(boolean q)`
  If true, suppress all messages.
  `void`
  `setTag(String p)`
  The tag of the package/module to operate upon.

  ### Methods inherited from class Task

  `bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType`
  Modifier and Type
  Method
  Description
  `final void`
  `bindToOwner(Task owner)`
  Bind a task to another; use this when configuring a newly created task to do work on behalf of another.
  `Target`
  `getOwningTarget()`
  Returns the container target of this task.
  `RuntimeConfigurable`
  `getRuntimeConfigurableWrapper()`
  Returns the wrapper used for runtime configuration.
  `String`
  `getTaskName()`
  Returns the name to use in logging messages.
  `String`
  `getTaskType()`
  Return the type of task.
  `protected RuntimeConfigurable`
  `getWrapper()`
  Return the runtime configurable structure for this task.
  `protected void`
  `handleErrorFlush(String output)`
  Handles an error line by logging it with the WARN priority.
  `protected void`
  `handleErrorOutput(String output)`
  Handles an error output by logging it with the WARN priority.
  `protected void`
  `handleFlush(String output)`
  Handles output by logging it with the INFO priority.
  `protected int`
  `handleInput(byte[] buffer, int offset, int length)`
  Handle an input request by this task.
  `protected void`
  `handleOutput(String output)`
  Handles output by logging it with the INFO priority.
  `void`
  `init()`
  Called by the project to let the task initialize properly.
  `protected final boolean`
  `isInvalid()`
  Has this task been marked invalid?
  `void`
  `log(String msg)`
  Logs a message with the default (INFO) priority.
  `void`
  `log(String msg, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `log(String msg, Throwable t, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `log(Throwable t, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `maybeConfigure()`
  Configures this task - if it hasn't been done already.
  `final void`
  `perform()`
  Performs this task if it's still valid, or gets a replacement version and performs that otherwise.
  `void`
  `reconfigure()`
  Force the task to be reconfigured from its RuntimeConfigurable.
  `void`
  `setOwningTarget(Target target)`
  Sets the target container of this task.
  `void`
  `setRuntimeConfigurableWrapper(RuntimeConfigurable wrapper)`
  Sets the wrapper to be used for runtime configuration.
  `void`
  `setTaskName(String name)`
  Sets the name to use in logging messages.
  `void`
  `setTaskType(String type)`
  Sets the name with which the task has been invoked.

  ### Methods inherited from class ProjectComponent

  `clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject`
  Modifier and Type
  Method
  Description
  `Object`
  `clone()`
  `String`
  `getDescription()`
  Returns the description of the current action.
  `Location`
  `getLocation()`
  Returns the file/location where this task was defined.
  `Project`
  `getProject()`
  Returns the project to which this component belongs.
  `void`
  `setDescription(String desc)`
  Sets a description of the current action.
  `void`
  `setLocation(Location location)`
  Sets the file/location where this task was defined.
  `void`
  `setProject(Project project)`
  Sets the project object of this component.

  ### Methods inherited from class Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Cvs

    public Cvs()
    CVS Task - now implemented by the Abstract CVS Task base class