    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.

##

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

##

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

##

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

##

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`.

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`.

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`.

cvspath_def

      public final static String cvspath_def

  The default CVS path.

cvsroot_def

      public final static String cvsroot_def

  The default CVS root path.

cvswrap_def

      public final static String cvswrap_def

  The default CVS wrapper path.

##

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.

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.

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.

##

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.

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.

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.

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.

getCommand

      protected String[] getCommand(String cvscmd[],
                                    boolean all)

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.

addEntry

      protected void addEntry(String name)

  Add an entry into this directory for the given file.
  Parameters:
    name - The file's name.

status

      public synchronized void status() throws CvsException

  Status each entry in this directory.
  Throws: CvsException
    If someting went wrong.

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.

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.

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.

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.

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.

refresh

      public synchronized void refresh() throws CvsException

  Recompute this directory in-memory image. This method will recompute the whole CVS state of the directory.

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.

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.

getDirectory

      public File getDirectory()

  Get this directory working directory.
  Returns:
    An instance of File.

getEntries

      public synchronized Enumeration getEntries()

  Get all entries contained by this directory.
  Returns:
    An enumeration, containing one element per items in the directory.

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.

print

      public void print(PrintStream out)

  Print this directory current state.

main

      public static void main(String args[]) throws CvsException

    All Packages  Class Hierarchy  This Package  Previous  Next  Index