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 LRUAble, CVS

Variable Index

 o cache
Our cache of existing CVS managers.
 o cachesize
Our recommended cache size.
 o clean
Has this directory manager been cleaned up (removed from cache).
 o cvscheck_stamp
The time at which we last checked the cvs status of that directory.
 o cvspath_def
The default CVS path.
 o CVSPATH_P
Property giving the path of the cvs binary.
 o cvsrep_stamp
The time at which we last examined the repository for this directory.
 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.
 o defprops
Get or create a manager for the given directory.
 o directory
The directory we manage.
 o entries
Known CVS entries (files)
 o lru
All CVS entries are LRU maintained too.
 o next
LRU management - next entry.
 o prev
LRU management - previous entry.
 o props
The properties we use for initialization.
 o repdir
The corresponding repository directory (when available).
 o runner
Our associated CvsRunner.

Constructor Index

 o CvsDirectory(File, Properties, String, String, String[])
Create a new CVS manager for the given directory.

Method Index

 o add(String[])
Add the given file to the CVS repository.
 o add(String[], String[])
Add the given file to the CVS repository.
 o cacheLoaded()
This directory manager is being fetched from the cache.
 o cacheUnload()
Remove a directory manager from the cache.
 o checkDirectoryUse()
This directory manager is about to be used for sub-directories.
 o checkUse()
This directory manager is about to be used, check it.
 o checkUse(String)
That file in the directory is about to be used, check its status.
 o commit(String)
Commit pending actions to all that directory content.
 o commit(String, String)
 o commit(String, String, String[])
 o commit(String, String[])
Commit pending actions to all that directory content.
 o commit(String[], String)
 o commit(String[], String, String[])
Commit pending actions on given file.
 o createDirectoryEntry(long, String, int)
 o createFileEntry(long, String, int)
 o diff(String)
Get the diff of given file against repository.
 o display(PrintStream)
Display the status of the entries in that directory.
 o getCvsDefaults()
 o getCvsWrapper()
 o getDirectory()
Get the directory controlled by this manager.
 o getDirectoryEntry(String)
Look for a sub-directory entry.
 o getDirectoryStatus(String)
Get a sub-directory status.
 o getFileEntry(String)
Look for a file entry.
 o getManager(CvsDirectory, File)
 o getManager(File)
 o getManager(File, Properties)
 o getManager(File, Properties, String, String, String[])
 o getNext()
LRU management - Get next node.
 o getPrev()
LRU management - Get previous node.
 o listDirectories()
List available sub-directories of that directory.
 o listFiles()
List all available file entries in that directory.
 o log(String)
Get the log associated to the given file.
 o main(String[])
 o needsUpdate()
Does this directory needs some CVS update ?
 o refresh()
Refresh the file entries for that directory.
 o remove(String[])
Remove the given file from the repository.
 o setNext(LRUAble)
LRU management - Set next node.
 o setPrev(LRUAble)
LRU management - Set previous node.
 o status(String)
Get the status of a file entry.
 o statusToString(int)
 o update()
Update all that directory's content.
 o update(String)
 o update(String[])
Update these files from the repository.
 o updateDirectory(String)
Check out, or update a sub-directory.
 o usage()

Variables

 o CVSPATH_P
 public static final 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 static final 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 static final 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 static final String cvspath_def
The default CVS path.

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

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

 o cache
 protected static Hashtable cache
Our cache of existing CVS managers. Maps absolute directory names to appropriate CvsDirectory instance.

 o lru
 protected static LRUList lru
All CVS entries are LRU maintained too.

 o cachesize
 protected static int cachesize
Our recommended cache size.

 o prev
 protected LRUAble prev
LRU management - previous entry.

 o next
 protected LRUAble next
LRU management - next entry.

 o cvscheck_stamp
 protected long cvscheck_stamp
The time at which we last checked the cvs status of that directory.

 o cvsrep_stamp
 protected long cvsrep_stamp
The time at which we last examined the repository for this directory.

 o clean
 protected boolean clean
Has this directory manager been cleaned up (removed from cache).

 o directory
 protected File directory
The directory we manage.

 o repdir
 protected File repdir
The corresponding repository directory (when available).

 o entries
 protected Hashtable entries
Known CVS entries (files)

 o runner
 protected CvsRunner runner
Our associated CvsRunner.

 o props
 public Properties props
The properties we use for initialization.

 o defprops
 public static Properties defprops
Get or create a manager for the given directory.

Constructors

 o CvsDirectory
 protected CvsDirectory(File directory,
                        Properties props,
                        String cvspath,
                        String cvsroot,
                        String cvswrap[]) throws CvsException
Create a new CVS manager for the given directory.

Parameters:
directory - The directory for which a manager is to be created.

Methods

 o getCvsWrapper
 protected String[] getCvsWrapper()
 o getCvsDefaults
 protected String[] getCvsDefaults()
 o createFileEntry
 protected synchronized void createFileEntry(long timestamp,
                                             String name,
                                             int status)
 o createDirectoryEntry
 protected synchronized void createDirectoryEntry(long timestamp,
                                                  String name,
                                                  int status)
 o getManager
 public static synchronized CvsDirectory getManager(File directory,
                                                    Properties props,
                                                    String cvspath,
                                                    String cvsroot,
                                                    String cvswrap[]) throws CvsException
 o getManager
 public static CvsDirectory getManager(File directory) throws CvsException
 o getManager
 public static CvsDirectory getManager(File directory,
                                       Properties props) throws CvsException
 o getManager
 protected static CvsDirectory getManager(CvsDirectory father,
                                          File dir) throws CvsException
 o getNext
 public LRUAble getNext()
LRU management - Get next node.

Returns:
A CvsDirectory instance.
 o getPrev
 public LRUAble getPrev()
LRU management - Get previous node.

Returns:
A CvsDirectory instance.
 o setNext
 public void setNext(LRUAble next)
LRU management - Set next node.

Returns:
A CvsDirectory instance.
 o setPrev
 public void setPrev(LRUAble prev)
LRU management - Set previous node.

Returns:
A CvsDirectory instance.
 o statusToString
 public static String statusToString(int st)
 o cacheLoaded
 protected void cacheLoaded() throws CvsException
This directory manager is being fetched from the cache. Perform any action before we return it back to the user.

Throws: CvsException
If some CVS action fails during reinitialization.
 o cacheUnload
 protected static synchronized void cacheUnload()
Remove a directory manager from the cache. Clear al references to other objects in order to free up memory even if the caller maintains a pointer to the manager.

 o getFileEntry
 protected CvsEntry getFileEntry(String filename)
Look for a file entry.

Parameters:
filename - The name of the entry to look for.
 o getDirectoryEntry
 protected CvsEntry getDirectoryEntry(String filename)
Look for a sub-directory entry.

Parameters:
filename - The name of the entry to look for.
 o refresh
 protected void refresh() throws CvsException
Refresh the file entries for that directory.

Throws: CvsException
If the underlying CVS command failed.
 o checkUse
 protected synchronized void checkUse() throws CvsException
This directory manager is about to be used, check it.

Throws: CvsException
If some CVS error occurs in that process.
 o checkUse
 protected synchronized void checkUse(String filename) throws CvsException
That file in the directory is about to be used, check its status.

Parameters:
filename - The name of the entry that is about to be used.
Throws: CvsException
If a CVS error occurs.
 o checkDirectoryUse
 protected synchronized void checkDirectoryUse() throws CvsException
This directory manager is about to be used for sub-directories.

 o needsUpdate
 protected boolean needsUpdate()
Does this directory needs some CVS update ?

 o listFiles
 public Enumeration listFiles() throws CvsException
List all available file entries in that directory. This method will list all possible files:

Returns:
An enumeration listing zero or more String instances.
Throws: CvsException
If some CVS error occured while examining the cvs status of entries.
 o listDirectories
 public Enumeration listDirectories() throws CvsException
List available sub-directories of that directory. This method will list of possible directories. If access to the repository is permitted, it will look into that to get a list of unchecked out directories, otherwise, it will just list the checked out ones.

Returns:
An enumeration listing zero or more File instances.
Throws: CvsException
If some CVS error occured while examining the cvs status of entries.
 o status
 public int status(String filename) throws CvsException
Get the status of a file entry.

Parameters:
filename - The file whose status is to be fetched.
Returns:
A integer status indicating the CVS status of that file within the repository.
Throws: CvsException
If some CVS error occured while examining the cvs status of entries.
 o update
 public void update(String files[]) throws CvsException
Update these files from the repository.

Parameters:
files - The name of the files to update (as a String array).
Throws: CvsException
If CVS process failed.
 o update
 public void update(String file) throws CvsException
 o update
 public void update() throws CvsException
Update all that directory's content.

Throws: CvsException
If some CVS error occured during update.
 o commit
 public void commit(String names[],
                    String msg,
                    String env[]) throws CvsException
Commit pending actions on given file.

Parameters:
names - The name of the files to commit.
msg - The associated message.
env - The extra env to use during commit.
Throws: CvsEXception
If some error occured during the CVS process.
 o commit
 public void commit(String file,
                    String msg,
                    String env[]) throws CvsException
 o commit
 public void commit(String names[],
                    String msg) throws CvsException
 o commit
 public void commit(String file,
                    String msg) throws CvsException
 o commit
 public void commit(String msg) throws CvsException
Commit pending actions to all that directory content.

Parameters:
msg - The associated message.
Throws: CvsException
If some CVS error occurs during the CVS process.
 o commit
 public void commit(String msg,
                    String env[]) throws CvsException
Commit pending actions to all that directory content.

Parameters:
msg - The associated message.
env - The extra environment.
Throws: CvsException
If some CVS error occurs during the CVS process.
 o log
 public String log(String filename) throws CvsException
Get the log associated to the given file.

Parameters:
filename - The name of the file whose log is to be fetched.
Throws: CvsException
If some CVS error occurs in the process.
 o diff
 public String diff(String filename) throws CvsException
Get the diff of given file against repository.

Parameters:
filename - The name of the file to diff.
Returns:
The diffs has a String, or null if the file is in sync with the repository.
Throws: CvsException
If some CVS exception occurs within the process.
 o add
 public void add(String names[]) throws CvsException
Add the given file to the CVS repository. The addition will have to be commited through a commit of the same file before taking effect.

Parameters:
names - The name of the files to add.
Throws: CvsException
If some CVS error occurs during the process.
 o add
 public void add(String names[],
                 String env[]) throws CvsException
Add the given file to the CVS repository. The addition will have to be commited through a commit of the same file before taking effect.

Parameters:
names - The name of the files to add.
env - The extra env to use during the process.
Throws: CvsException
If some CVS error occurs during the process.
 o remove
 public void remove(String names[]) throws CvsException
Remove the given file from the repository.

Parameters:
names - The files to be removed.
Throws: CvsException
If some CVS error occurs during that process.
 o display
 public void display(PrintStream prt)
Display the status of the entries in that directory.

Parameters:
prt - A print stream to print to.
 o getDirectoryStatus
 public int getDirectoryStatus(String subdir) throws CvsException
Get a sub-directory status.

Parameters:
subdir - The name of the subdirectory.
Returns:
An integer CVS status for the given sub-directory.
 o updateDirectory
 public void updateDirectory(String subdir) throws CvsException
Check out, or update a sub-directory.

Parameters:
subdir - The sub directory to update.
Throws: CvsException
If the CVS process failed.
 o getDirectory
 public File getDirectory()
Get the directory controlled by this manager.

Returns:
A File instance locating the directory.
 o usage
 public static void usage()
 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index