|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Repository
This is the main entry point for the version control package. See also the
package overview
. The name of this interface
is a little misleading: it doesn't really model version control
repositories, but version control commands. In a perfect world it
would be renamed.
Version control repository interface. Implementors are intended to use bean-type parameterisation and initialisation. The lifecycle is:
init()
which will validate the parameters and put the object in
a usable state
init()
before other methods is
create(java.lang.String)
, which can be called on an unitialised object (so that we
can create repositories without having an existing one).
Implementors are expected to execute the command-line repository program
to do the work specified by this API. The anticipated uses are with CVS
and SVN. The API is kept close to the underlying version control systems,
so, for example, to delete a file first delete the actual file from disk,
then call delete(java.lang.String)
, then call checkin(java.lang.String)
to commit the
deletion.
A Repository object may also be obtained from
AbstractRepository.getRepository(java.lang.String)
.
Method Summary | |
---|---|
boolean |
add(String fileName)
Add to the repository. |
boolean |
checkin(String fileName)
Commit changes. |
boolean |
checkin(String fileName,
String message)
Commit changes. |
boolean |
checkout(String fileName)
Check out a file, directory or module. |
boolean |
create(String dirName)
Create a new repository filetree (i.e. not a new object but a new database/filesystem on disk). |
boolean |
delete(String fileName)
Delete from the repository. |
String |
diff(String fileName)
Get the difference with the repository version. |
boolean |
exists(String moduleName)
Check for the existence of a module (i.e. top-level directory). |
String |
getCommandName()
Name of the repository command to execute (e.g. cvs, svn). |
String |
getCommandOutput()
Get a string containing the stdout and stderr from the command execution. |
String |
getCommandStderr()
Get a string containing the stderr from the command execution. |
String |
getCommandStdout()
Get a string containing the stdout from the command execution. |
String |
getRoot()
The root / URL of the repository |
boolean |
importDir(String dirName)
Import a directory. |
void |
init()
Validate parameters. |
boolean |
isModified(String fileName)
Use the repository's status command to figure out if the file has been locally modified. |
boolean |
isOutOfDate(String fileName)
Use the repository's status command to figure out if the file is out-of-date. |
boolean |
isUnknown(String fileName)
Use the repository's status command to figure out if the file is unknown. |
void |
setRoot(String root)
The root / URL of the repository |
void |
setWorkingDir(File workingDir)
The working directory for repository actions |
String |
status(String fileName)
Status. |
boolean |
update(String fileName)
Update. |
Method Detail |
---|
void init() throws gate.util.GateException
gate.util.GateException
String getCommandName()
void setRoot(String root)
String getRoot()
void setWorkingDir(File workingDir)
boolean checkout(String fileName)
fileName
- the file or directory to work on (should be relative
to the repository's working directory, and use "/" as a path separator).
boolean checkin(String fileName)
fileName
- the file or directory to work on (should be relative
to the repository's working directory, and use "/" as a path separator).
boolean checkin(String fileName, String message)
fileName
- the file or directory to work on (should be relative
to the repository's working directory, and use "/" as a path separator).message
- a commit message.
boolean update(String fileName)
fileName
- the file or directory to work on (should be relative
to the repository's working directory, and use "/" as a path separator).
String status(String fileName)
fileName
- the file or directory to work on (should be relative
to the repository's working directory, and use "/" as a path separator).
boolean isModified(String fileName)
fileName
- the file or directory to work on (should be relative
to the repository's working directory, and use "/" as a path separator).
boolean isOutOfDate(String fileName)
fileName
- the file or directory to work on (should be relative
to the repository's working directory, and use "/" as a path separator).
boolean isUnknown(String fileName)
exists(java.lang.String)
.
fileName
- the file or directory to work on (should be relative
to the repository's working directory, and use "/" as a path separator).
boolean exists(String moduleName)
moduleName
- directory to look for.
boolean delete(String fileName)
fileName
- the file or directory to work on (should be relative
to the repository's working directory, and use "/" as a path separator).
boolean add(String fileName)
fileName
- the file or directory to work on (should be relative
to the repository's working directory, and use "/" as a path separator).
String diff(String fileName)
fileName
- the file or directory to work on (should be relative
to the repository's working directory, and use "/" as a path separator).
boolean create(String dirName) throws gate.util.GateException
dirName
- the directory to work on, which will be created
(should be an absolute path).
gate.util.GateException
boolean importDir(String dirName) throws gate.util.GateException
dirName
- the directory to import (this must exist).
gate.util.GateException
- when the directory doesn't exist.String getCommandStdout()
String getCommandStderr()
String getCommandOutput()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |