Class w3c.cvs.CvsDirectory
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.cvs.CvsDirectory

java.lang.Object
   |
   +----w3c.cvs.CvsDirectory

public class CvsDirectory
extends Object
Implements a per-directory CVS state object.

Variable Index

 o cvspath_def
The default CVS path.
 o CVSPATH_P
Property giving the path of the cvs binary.
 o cvsroot_def
The default CVS root path.
 o CVSROOT_P
Property giving your CVS repository.
 o cvswrap_def
The default CVS wrapper path.
 o CVSWRAP_P
Property giving the path of the cvswrapper.

Constructor Index

 o CvsDirectory(File)
Create an in-memory image of the CVS state of the directory.
 o CvsDirectory(Properties, File)
Create an in-memory image of the CVS state of the directory.
 o CvsDirectory(String, String, String, File)
Create an in-memory image of the CVS state of a directory.

Method Index

 o add(String, CvsEntry[])
Add new entries for this directory to CVS control.
 o addEntry(String)
Add an entry into this directory for the given file.
 o commit(String, CvsEntry[])
Commit the given set of files, with the provided message.
 o diff(CvsEntry)
Get the given entry diff, as a String.
 o error(String, String)
Emit an error.
 o getCommand(String[], boolean)
 o getCommand(String[], CvsEntry[])
Build a command vector, including the given set of targets.
 o getDirectory()
Get this directory working directory.
 o getEntries()
Get all entries contained by this directory.
 o initialize()
Initialize this directory.
 o log(CvsEntry)
Get the given entry log, as a String.
 o log(String)
Log some transaction.
 o lookup(String)
Lookup a CVS entry by name.
 o main(String[])
 o print(PrintStream)
Print this directory current state.
 o refresh()
Recompute this directory in-memory image.
 o remove(CvsEntry[])
Remove an entry from CVS control.
 o runCvsProcess(String[])
Run a cvs command, return the process object.
 o status()
Status each entry in this directory.
 o temporaryFile(String)
Dump the given string into a temporary file.
 o update(CvsEntry[])
Update the given set of files.

Variables

 o CVSPATH_P
  public final static String CVSPATH_P
Property giving the path of the cvs binary. This property should be set to the absolute path to the cvs command in your local environment.

This property defaults to /usr/local/bin/cvs.

 o CVSROOT_P
  public final static String CVSROOT_P
Property giving your CVS repository. This property should be set to the absolute path of your repository.

This property defaults to /afs/w3.org/pub/WWW.

 o CVSWRAP_P
  public final static String CVSWRAP_P
Property giving the path of the cvswrapper. Because CVS can't run without being in the right directory, this classes use a shell script wrapper to issue cvs commands, that will change directory appropriately.

You should have gotten this wrapper in the distribution bin directory.

This property defaults to /afs/w3.org/usr/abaird/Jigsaw/bin/cvs_wrapper.

 o cvspath_def
  public final static String cvspath_def
The default CVS path.
 o cvsroot_def
  public final static String cvsroot_def
The default CVS root path.
 o cvswrap_def
  public final static String cvswrap_def
The default CVS wrapper path.

Constructors

 o CvsDirectory
  public CvsDirectory(File directory) throws CvsException
Create an in-memory image of the CVS state of the directory. This constructor will get your CVS settings from the global properties.
Parameters:
directory - The directory to examine.
 o CvsDirectory
  public CvsDirectory(Properties props,
                      File directory) throws CvsException
Create an in-memory image of the CVS state of the directory. This constructo will get your CVS settings from the provided properties.
Parameters:
props - Were to get your CVS settings from.
directory - The directory to exmaine.
 o CvsDirectory
  public CvsDirectory(String cvspath,
                      String cvsroot,
                      String cvswrap,
                      File directory) throws CvsException
Create an in-memory image of the CVS state of a directory. This constructor allows you to specify explicitly the CVS settings.
Parameters:
cvspath - The absolute path of the cvs command.
cvsroot - The absolute path of the CVS repository.
cvswrap - The absolute path of the CVS wrapper script.
directory - The directory you want to examine.

Methods

 o temporaryFile
  protected File temporaryFile(String string) throws CvsException
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.
 o log
  protected void log(String msg)
Log some transaction. This defaults to printing some messages to the std output.
Parameters:
msg - The message to emit.
 o error
  protected void error(String mth,
                       String msg) throws CvsException
Emit an error. Some abnormal situation occured, emit an error message.
Parameters:
mth - The method in which the error occured.
msg - The message to emit.
Throws: CvsException
The exception that will be thrown as a result of the error.
 o getCommand
  protected String[] getCommand(String cvscmd[],
                                CvsEntry targets[])
Build a command vector, including the given set of targets.
Parameters:
cvscmd - The CVS comand to prepare for.
vfiles - The set of target files. If this is null include all possible files as a target.
Returns:
A command vector suitable for use as an exec argument.
 o getCommand
  protected String[] getCommand(String cvscmd[],
                                boolean all)
 o runCvsProcess
  protected Process runCvsProcess(String args[]) throws IOException
Run a cvs command, return the process object.
Throws: CvsException
If the process couldn't be launched.
 o addEntry
  protected void addEntry(String name)
Add an entry into this directory for the given file.
Parameters:
name - The file's name.
 o status
  public synchronized void status() throws CvsException
Status each entry in this directory.
Throws: CvsException
If someting went wrong.
 o update
  public synchronized void update(CvsEntry entries[]) throws CvsException
Update the given set of files.
Parameters:
vnames - The set of files to update, as a Vector of String.
Throws: CvsException
If something failed.
 o commit
  public synchronized void commit(String msg,
                                  CvsEntry entries[]) throws CvsException
Commit the given set of files, with the provided message.
Parameters:
msg - The commit messsage, describing changes.
entries - The entries to commit.
Throws: CvsException
If commiting failed.
 o log
  public synchronized String log(CvsEntry entry) throws CvsException
Get the given entry log, as a String.
Parameters:
entry - The entry whose log is queried.
Throws: CvsException
If getting the log failed.
 o diff
  public synchronized String diff(CvsEntry entry) throws CvsException
Get the given entry diff, as a String.
Parameters:
entry - The entry whose diff is queried.
Throws: CvsException
If getting the diff failed.
 o add
  public synchronized void add(String msg,
                               CvsEntry entries[]) throws CvsException
Add new entries for this directory to CVS control.
Parameters:
msg - A message describing the entries.
entries - The entries to put under CVS control.
 o refresh
  public synchronized void refresh() throws CvsException
Recompute this directory in-memory image. This method will recompute the whole CVS state of the directory.
 o remove
  public synchronized void remove(CvsEntry entries[])
Remove an entry from CVS control. This is not implemented since this would mean that the program would have to delete the file first.
Parameters:
entries - The entries to remove from CVS control.
 o lookup
  public CvsEntry lookup(String name)
Lookup a CVS entry by name.
Parameters:
The - name of the entry to look for.
Returns:
An instance of CvsEntry, or null.
 o getDirectory
  public File getDirectory()
Get this directory working directory.
Returns:
An instance of File.
 o getEntries
  public synchronized Enumeration getEntries()
Get all entries contained by this directory.
Returns:
An enumeration, containing one element per items in the directory.
 o initialize
  protected void initialize() throws CvsException
Initialize this directory. Get the list of files potentially under CVS control, build one entry for each of them, and save them into a hashtable. Than update all their status to get into initial state.
 o print
  public void print(PrintStream out)
Print this directory current state.
 o main
  public static void main(String args[]) throws CvsException

All Packages  Class Hierarchy  This Package  Previous  Next  Index