|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.w3c.cvs.CvsDirectory
public class CvsDirectory
Field Summary | |
---|---|
protected static java.util.Hashtable |
cache
Our cache of existing CVS managers. |
protected static int |
cachesize
Our recommended cache size. |
protected boolean |
clean
Has this directory manager been cleaned up (removed from cache). |
protected long |
cvscheck_stamp
The time at which we last checked the cvs status of that directory. |
static java.lang.String |
cvspath_def
The default CVS path. |
static java.lang.String |
CVSPATH_P
Property giving the path of the cvs binary. |
protected long |
cvsrep_stamp
The time at which we last examined the repository for this directory. |
static java.lang.String |
cvsroot_def
The default CVS root path. |
static java.lang.String |
CVSROOT_P
Property giving your CVS repository. |
static java.lang.String |
cvswrap_def
The default CVS wrapper path. |
static java.lang.String |
CVSWRAP_P
Property giving the path of the cvswrapper. |
static java.util.Properties |
defprops
|
protected java.io.File |
directory
The directory we manage. |
protected java.util.Hashtable |
entries
Known CVS entries (files) |
protected static LRUList |
lru
All CVS entries are LRU maintained too. |
protected LRUAble |
next
LRU management - next entry. |
protected LRUAble |
prev
LRU management - previous entry. |
java.util.Properties |
props
The properties we use for initialization. |
protected java.io.File |
repdir
The corresponding repository directory (when available). |
protected org.w3c.cvs.CvsRunner |
runner
Our associated CvsRunner. |
Fields inherited from interface org.w3c.cvs.CVS |
---|
DIR_CO, DIR_NCO, DIR_Q, FILE_A, FILE_C, FILE_M, FILE_NCO, FILE_OK, FILE_Q, FILE_R, FILE_U, status |
Constructor Summary | |
---|---|
protected |
CvsDirectory(java.io.File directory,
java.util.Properties props,
java.lang.String cvspath,
java.lang.String cvsroot,
java.lang.String[] cvswrap)
Create a new CVS manager for the given directory. |
Method Summary | |
---|---|
void |
add(java.lang.String[] names)
Add the given file to the CVS repository. |
void |
add(java.lang.String[] names,
java.lang.String[] env)
Add the given file to the CVS repository. |
void |
addRegexp(java.lang.String regexp,
java.lang.String[] env)
Add the file matching the given regular expression to the CVS repository. |
void |
admin(java.lang.String[] command)
Perform a RCS request. |
protected void |
cacheLoaded()
This directory manager is being fetched from the cache. |
protected static void |
cacheUnload()
Remove a directory manager from the cache. |
protected void |
checkDirectoryUse()
This directory manager is about to be used for sub-directories. |
protected void |
checkDirectoryUse(java.lang.String subdir)
This directory manager is about to be used for the given sub-directory. |
protected void |
checkUse()
This directory manager is about to be used, check it. |
protected void |
checkUse(java.lang.String filename)
That file in the directory is about to be used, check its status. |
void |
commit(java.lang.String msg)
Commit pending actions to all that directory content. |
void |
commit(java.lang.String[] names,
java.lang.String msg)
Commit pending actions on given file. |
void |
commit(java.lang.String[] names,
java.lang.String msg,
java.lang.String[] env)
Commit pending actions on given file. |
void |
commit(java.lang.String file,
java.lang.String msg)
Commit pending actions on given file. |
void |
commit(java.lang.String msg,
java.lang.String[] env)
Commit pending actions to all that directory content. |
void |
commit(java.lang.String file,
java.lang.String msg,
java.lang.String[] env)
Commit pending actions on given file. |
void |
commitRegexp(java.lang.String regexp,
java.lang.String comment,
java.lang.String[] env)
Commit pending actions on files matching the given regular expression. |
protected void |
createDirectoryEntry(long timestamp,
java.lang.String name,
int status)
|
protected void |
createFileEntry(long timestamp,
java.lang.String name,
int status)
|
java.lang.String |
diff(java.lang.String filename)
Get the diff of given file against repository. |
void |
display(java.io.PrintStream prt)
Display the status of the entries in that directory. |
void |
get(java.lang.String path)
Perform a cvs get |
protected java.lang.String[] |
getCvsDefaults()
|
protected java.lang.String[] |
getCvsWrapper()
|
java.io.File |
getDirectory()
Get the directory controlled by this manager. |
protected org.w3c.cvs.CvsEntry |
getDirectoryEntry(java.lang.String filename)
Look for a sub-directory entry. |
int |
getDirectoryStatus(java.lang.String subdir)
Get a sub-directory status. |
int |
getDirectoryStatus(java.lang.String subdir,
boolean update)
Get a sub-directory status. |
protected org.w3c.cvs.CvsEntry |
getFileEntry(java.lang.String filename)
Look for a file entry. |
protected static CvsDirectory |
getManager(CvsDirectory father,
java.io.File dir)
|
static CvsDirectory |
getManager(java.io.File directory)
Get a CvsDirectory. |
static CvsDirectory |
getManager(java.io.File directory,
java.util.Properties props)
|
static CvsDirectory |
getManager(java.io.File directory,
java.util.Properties props,
java.lang.String cvspath,
java.lang.String cvsroot,
java.lang.String[] cvswrap)
Get a CvsDirectory. |
LRUAble |
getNext()
LRU management - Get next node. |
LRUAble |
getPrev()
LRU management - Get previous node. |
java.util.Enumeration |
listDirectories()
List available sub-directories of that directory. |
java.util.Enumeration |
listFiles()
List all available file entries in that directory. |
java.lang.String |
log(java.lang.String filename)
Get the log associated to the given file. |
static void |
main(java.lang.String[] args)
|
protected boolean |
needsUpdate()
Does this directory needs some CVS update ? |
void |
refresh()
Refresh the file entries for that directory. |
protected void |
refresh(java.lang.String filename)
Refresh the file entries for that filename. |
protected void |
refreshRevision(java.lang.String filename)
Refresh the file entry revision number for that filename. |
protected void |
refreshStatus(java.lang.String filename)
Refresh the file entry status for that filename. |
void |
remove(java.lang.String[] names,
java.lang.String msg,
java.lang.String[] env)
Remove the given file from the repository. |
protected void |
removeFileEntry(java.lang.String filename)
|
void |
revert(java.lang.String filename,
java.io.OutputStream out,
java.lang.String revision,
java.lang.String[] env)
Revert the file, make the given revision the current one. |
void |
revert(java.lang.String filename,
java.lang.String revision,
java.lang.String msg,
java.lang.String[] env)
Revert the file, make the given revision the current one. |
java.lang.String |
revision(java.lang.String filename)
Get the revision number of the given file. |
void |
setNext(LRUAble next)
LRU management - Set next node. |
void |
setPrev(LRUAble prev)
LRU management - Set previous node. |
int |
status(java.lang.String filename)
Get the status of a file entry. |
int |
status(java.lang.String filename,
boolean refresh)
Get the status of a file entry. |
static java.lang.String |
statusToString(int st)
|
java.lang.String |
stickyOptions(java.lang.String filename)
Get the Sticky Options of the given file. |
void |
update()
Update all that directory's content. |
void |
update(java.lang.String file)
Update this file from the repository. |
void |
update(java.lang.String[] files)
Update these files from the repository. |
void |
updateDirectory(java.lang.String subdir)
Check out, or update a sub-directory. |
void |
updateRegexp(java.lang.String regexp)
Update thes files matching the given regular expression from the repository. |
static void |
usage()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CVSPATH_P
This property defaults to /usr/local/bin/cvs
.
public static final java.lang.String CVSROOT_P
This property defaults to /afs/w3.org/pub/WWW
.
public static final java.lang.String CVSWRAP_P
You should have gotten this wrapper in the distribution
bin
directory.
This property defaults to
/afs/w3.org/usr/abaird/Jigsaw/bin/cvs_wrapper
.
public static final java.lang.String cvspath_def
public static final java.lang.String cvsroot_def
public static final java.lang.String cvswrap_def
protected static java.util.Hashtable cache
protected static LRUList lru
protected static int cachesize
protected LRUAble prev
protected LRUAble next
protected long cvscheck_stamp
protected long cvsrep_stamp
protected boolean clean
protected java.io.File directory
protected java.io.File repdir
protected java.util.Hashtable entries
protected org.w3c.cvs.CvsRunner runner
public java.util.Properties props
public static java.util.Properties defprops
Constructor Detail |
---|
protected CvsDirectory(java.io.File directory, java.util.Properties props, java.lang.String cvspath, java.lang.String cvsroot, java.lang.String[] cvswrap) throws CvsException
directory
- The directory for which a manager is to be created.props
- The cvs properties.cvspath
- The absolute path of the cvs program.cvsroot
- The absolute path of the CVS repository.cvswrap
- The absolute path of the cvs wrapper program
CvsException
- If some initialisation failedMethod Detail |
---|
protected java.lang.String[] getCvsWrapper()
protected java.lang.String[] getCvsDefaults()
protected void createFileEntry(long timestamp, java.lang.String name, int status)
protected void createDirectoryEntry(long timestamp, java.lang.String name, int status)
public static CvsDirectory getManager(java.io.File directory, java.util.Properties props, java.lang.String cvspath, java.lang.String cvsroot, java.lang.String[] cvswrap) throws CvsException
directory
- The CVS directory.props
- The cvs properties.cvspath
- The absolute path of the cvs program.cvsroot
- The absolute path of the CVS repository.cvswrap
- The absolute path of the cvs wrapper program
CvsException
- If some initialisation failedpublic static CvsDirectory getManager(java.io.File directory) throws CvsException
directory
- The CVS directory
CvsException
- If some initialisation failedpublic static CvsDirectory getManager(java.io.File directory, java.util.Properties props) throws CvsException
directory
- The CVS directory.props
- The cvs properties.
CvsException
- If some initialisation failedprotected static CvsDirectory getManager(CvsDirectory father, java.io.File dir) throws CvsException
father
- The father CvsDirectory.directory
- The CVS directory.
CvsException
- If some initialisation failedpublic LRUAble getNext()
getNext
in interface LRUAble
public LRUAble getPrev()
getPrev
in interface LRUAble
public void setNext(LRUAble next)
setNext
in interface LRUAble
public void setPrev(LRUAble prev)
setPrev
in interface LRUAble
public static java.lang.String statusToString(int st)
protected void cacheLoaded() throws CvsException
CvsException
- If some CVS action fails during
reinitialization.protected static void cacheUnload()
protected org.w3c.cvs.CvsEntry getFileEntry(java.lang.String filename)
filename
- The name of the entry to look for.protected void removeFileEntry(java.lang.String filename)
protected org.w3c.cvs.CvsEntry getDirectoryEntry(java.lang.String filename)
filename
- The name of the entry to look for.public void refresh() throws CvsException
CvsException
- If the underlying CVS command failed.protected void refresh(java.lang.String filename) throws CvsException
CvsException
- If the underlying CVS command failed.protected void refreshStatus(java.lang.String filename) throws CvsException
CvsException
- If the underlying CVS command failed.protected void refreshRevision(java.lang.String filename) throws CvsException
CvsException
- If the underlying CVS command failed.protected void checkUse() throws CvsException
CvsException
- If some CVS error occurs in that process.protected void checkUse(java.lang.String filename) throws CvsException
filename
- The name of the entry that is about to be used.
CvsException
- If a CVS error occurs.protected void checkDirectoryUse() throws CvsException
CvsException
- If a CVS error occurs.protected void checkDirectoryUse(java.lang.String subdir) throws CvsException
CvsException
- If a CVS error occurs.protected boolean needsUpdate()
public java.util.Enumeration listFiles() throws CvsException
CvsException
- If some CVS error occured while examining
the cvs status of entries.public java.util.Enumeration listDirectories() throws CvsException
CvsException
- If some CVS error occured while examining
the cvs status of entries.public int status(java.lang.String filename, boolean refresh) throws CvsException
filename
- The file whose status is to be fetched.refresh
- Should we refresh the status?
CvsException
- If some CVS error occured while examining
the cvs status of entries.public int status(java.lang.String filename) throws CvsException
filename
- The file whose status is to be fetched.
CvsException
- If some CVS error occured while examining
the cvs status of entries.public java.lang.String revision(java.lang.String filename) throws CvsException
filename
- The File name
CvsException
- if some CVS errors occurspublic java.lang.String stickyOptions(java.lang.String filename) throws CvsException
filename
- The File name
CvsException
- if some CVS errors occurspublic void update(java.lang.String[] files) throws CvsException
files
- The name of the files to update (as a String array).
CvsException
- If CVS process failed.public void update(java.lang.String file) throws CvsException
file
- The name of the file to update (as a String).
CvsException
- If CVS process failed.public void update() throws CvsException
CvsException
- If some CVS error occured during update.public void updateRegexp(java.lang.String regexp) throws CvsException
files
- The name of the files to update (as a String array).
CvsException
- If CVS process failed.public void get(java.lang.String path) throws CvsException
path
- the file (or directory) path
CvsException
- If CVS process failed.public void commit(java.lang.String[] names, java.lang.String msg, java.lang.String[] env) throws CvsException
names
- The name of the files to commit.msg
- The associated message.env
- The extra env to use during commit.
CvsException
- If some error occured during the CVS process.public void commit(java.lang.String file, java.lang.String msg, java.lang.String[] env) throws CvsException
file
- The file to commit.msg
- The associated message.env
- The extra env to use during commit.
CvsException
- If some error occured during the CVS process.public void commit(java.lang.String[] names, java.lang.String msg) throws CvsException
names
- The name of the files to commit.msg
- The associated message.
CvsException
- If some error occured during the CVS process.public void commit(java.lang.String file, java.lang.String msg) throws CvsException
file
- The file to commit.msg
- The associated message.
CvsException
- If some error occured during the CVS process.public void commit(java.lang.String msg) throws CvsException
msg
- The associated message.
CvsException
- If some CVS error occurs during the CVS process.public void commit(java.lang.String msg, java.lang.String[] env) throws CvsException
msg
- The associated message.env
- The extra environment.
CvsException
- If some CVS error occurs during the CVS process.public void commitRegexp(java.lang.String regexp, java.lang.String comment, java.lang.String[] env) throws CvsException
regexp
- The regular expresion.msg
- The associated message.env
- The extra env to use during commit.
CvsException
- If some error occured during the CVS process.public void revert(java.lang.String filename, java.lang.String revision, java.lang.String msg, java.lang.String[] env) throws CvsException
filename
- The name of the file to revert.revision
- The revision number to get.msg
- The associated message.env
- The extra environment.
CvsException
- If some CVS error occurs during the CVS process.public void revert(java.lang.String filename, java.io.OutputStream out, java.lang.String revision, java.lang.String[] env) throws CvsException
filename
- The name of the file to revert.revision
- The revision number to get.out
- The output stream. (reverted file will be written in)env
- The extra environment.
CvsException
- If some CVS error occurs during the CVS process.public java.lang.String log(java.lang.String filename) throws CvsException
filename
- The name of the file whose log is to be fetched.
CvsException
- If some CVS error occurs in the process.public java.lang.String diff(java.lang.String filename) throws CvsException
filename
- The name of the file to diff.
CvsException
- If some CVS exception occurs within the
process.public void add(java.lang.String[] names) throws CvsException
names
- The name of the files to add.
CvsException
- If some CVS error occurs during the process.public void add(java.lang.String[] names, java.lang.String[] env) throws CvsException
names
- The name of the files to add.env
- The extra env to use during the process.
CvsException
- If some CVS error occurs during the process.public void addRegexp(java.lang.String regexp, java.lang.String[] env) throws CvsException
regexp
- The regular expression.env
- The extra env to use during the process.
CvsException
- If some CVS error occurs during the process.public void remove(java.lang.String[] names, java.lang.String msg, java.lang.String[] env) throws CvsException
names
- The files to be removed.
CvsException
- If some CVS error occurs during that process.public void admin(java.lang.String[] command) throws CvsException
command
- the rcs command splitted in a string array.
CvsException
- If some CVS error occurs during that process.public void display(java.io.PrintStream prt)
prt
- A print stream to print to.public int getDirectoryStatus(java.lang.String subdir) throws CvsException
subdir
- The name of the subdirectory.
CvsException
- if the CVS process failed.public int getDirectoryStatus(java.lang.String subdir, boolean update) throws CvsException
subdir
- The name of the subdirectory.update
- If true update all directory entries.
CvsException
- if the CVS process failed.public void updateDirectory(java.lang.String subdir) throws CvsException
subdir
- The sub directory to update.
CvsException
- If the CVS process failed.public java.io.File getDirectory()
public static void usage()
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |