The CVSProject class implements the concept of a local
CVS project directory. A local project directory can be
thought of as a local source code working directory that
contains a CVS directory containing CVS administration files.
Combined with CVSClient, this class provides everything
you need to communicate with a CVS Server and maintain
local working directories for CVS repositories.
version: $Revision: 2.26 $ author: Timothy Gerard Endres,
adminPathToRootPath(String dirName) Parses a valid CVS Administration Directory path
and returns the pathname of the working directory
that the administration directory belongs to.
checkReleaseStatus(CVSIgnore ignore, Vector mods, Vector adds, Vector rems, Vector unks) This is used for the 'release' command to determine
if the project has any modifications the user might
not want to lose.
ensureRepositoryPath(CVSUserInterface ui, String localDirectory, CVSResponse resultResp) Guarentees that the repository contains the path specified.
This will in turn invoke server commands to create the
directories needed to make the path exist, so this can and
will change the repository on the server.
entriesPathToAdminPath(String entriesPath) Parses a valid CVS Entries File pathname and
returns the pathname of the admin directory
that the entries files belongs to.
establishNewDirSticky(CVSRequest request, CVSEntry entry) This methods deal with adding a new directory which is not
yet in the repository, and yet, whose parent directory has
a sticky tag set.
getPathIgnoringCase(String subPath) Given a repository path, which was not found in the
pathTable, determine if the path is in the table if
case is ignored.
isValidAdminPath(String dirName) Determines if a pathname, provided by the dirName
parameter, is a valid CVS administration directory
(i.e., is a directory named 'CVS').
normalizeLocalDirectory(String pathName, String repository) Given a local-directory returned from the server,
make sure the local-directory is in a format that
jCVS can make use of (i.e., via the pathTable).
Currently, the only case handled is when local-directory
is './', which forces us to locate from pathTable.
Parameters: pathName - The local-directory from the server. Parameters: repository - The repository the server sent with this local-directory.
Constructs a new CVSProject object, setting the
project's client to the one provided.
Parameters: client - A CVSClient object to be used by thisproject for all CVS server requests.
Parses a valid CVS Administration Directory path
and returns the pathname of the working directory
that the administration directory belongs to. In
other words, it returns the directory's parent.
Parameters: dirName - the pathname of the admin directory
This is used for the 'release' command to determine
if the project has any modifications the user might
not want to lose.
True if the project has any changes user might want to save.
copyFile
public boolean copyFile(File from, File to, int translation, boolean isGZIPed)(Code)
copyFileAscii
public boolean copyFileAscii(File from, File to, boolean isGZIPed)(Code)
copyFileRaw
public boolean copyFileRaw(File from, File to, boolean isGZIPed)(Code)
Guarentees that the repository contains the path specified.
This will in turn invoke server commands to create the
directories needed to make the path exist, so this can and
will change the repository on the server. The repositoryPath
is relative to the repository's root directory.
Parameters: ui - The CVS User Interface to display the progress. Parameters: localDirectory - The relative path to ensure. A CVSResponse with the results of each directory 'add'.
Parses a valid CVS Entries File pathname and
returns the pathname of the admin directory
that the entries files belongs to. In other
words, it returns the directory's parent.
Parameters: entriesPath - The pathname of the Entries file.
This methods deal with adding a new directory which is not
yet in the repository, and yet, whose parent directory has
a sticky tag set. We wish to "inherit" that tag...
establishRootEntry
public void establishRootEntry(String repository)(Code)
Parameters: repository - The server's repository pathname for the root.
Given the administrative directory pathname, return
the full pathname of the 'Entries' file.
Parameters: adminDirPath - The pathname of the admin ('CVS') directory.
Given the administrative directory pathname, return
the full pathname of the 'Notify' file.
Parameters: adminDirPath - The pathname of the admin ('CVS') directory.
Given the administrative directory pathname, return
the full pathname of the project preferences file.
Parameters: adminDirPath - The pathname of the admin ('CVS') directory.
Given the administrative directory pathname, return
the full pathname of the 'Repository' file.
Parameters: adminDirPath - The pathname of the admin ('CVS') directory.
Given the administrative directory pathname, return
the full pathname of the 'Root' file.
Parameters: adminDirPath - The pathname of the admin ('CVS') directory.
Given a 'local directory' (in the protocol sense), get the
corresponding directory CVSEntry. This method will return
null if the directory hierarchy has not been "ensured" yet.
Parameters: localDir - The directory's 'local directory' name.
Given a repository path, which was not found in the
pathTable, determine if the path is in the table if
case is ignored. This is to support platforms which
have case insensitive path names.
Parameters: subPath - The path to check for in the table. The CVSEntry representing the path's directory.
public static boolean isValidAdminPath(String dirName)(Code)
Determines if a pathname, provided by the dirName
parameter, is a valid CVS administration directory
(i.e., is a directory named 'CVS').
Parameters: dirName - the pathname of the directory in question
Given a local-directory returned from the server,
make sure the local-directory is in a format that
jCVS can make use of (i.e., via the pathTable).
Currently, the only case handled is when local-directory
is './', which forces us to locate from pathTable.
Parameters: pathName - The local-directory from the server. Parameters: repository - The repository the server sent with this local-directory. The normalized local-directory, or null if it does not exist.
Given an entry, update the entry in our project. If the
entry is new (not found), then add it to our project.
Parameters: newEntry - The entry to update.
public static boolean verifyAdminDirectory(String dirName)(Code)
Verifies that a directory path is a valid CVS
administration directory. This checks for the
correct name ('CVS'), and that the necessary
files ('Entries', 'Root' and 'Repository') are
present.
Parameters: dirName - the pathname of the admin directory true if directory is valid, otherwise false