public class StandardAdminHandler extends Object implements AdminHandler
This implementation strives to provide complete compatibility with the standard CVS client, so that operations on locally checked-out files can be carried out by either this library or the standard client without causing the other to fail. Any such failure should be considered a bug in this library.
Constructor and Description |
---|
StandardAdminHandler() |
Modifier and Type | Method and Description |
---|---|
boolean |
exists(File file)
Simply delegates to File.exists(), does not provide any virtual files.
|
Set<File> |
getAllFiles(File directory)
Get all the files contained within a given directory that are known to
CVS.
|
Iterator<Entry> |
getEntries(File directory)
Get the entries for a specified directory.
|
Entry[] |
getEntriesAsArray(File directory)
Get the entries for a specified directory.
|
Entry |
getEntry(File file)
Get the Entry for the specified file, if one exists
|
String |
getRepositoryForDirectory(String directory,
String repository)
Get the repository path for a given directory, for example in the
directory /home/project/foo/bar, the repository directory might be
/usr/cvs/foo/bar.
|
String |
getStickyTagForDirectory(File directory)
Checks for presence of CVS/Tag file and returns it's value.
|
void |
removeEntry(File file)
Remove the Entry for the specified file
|
void |
setEntry(File file,
Entry entry)
Set the Entry for the specified file
|
void |
updateAdminData(String localDirectory,
String repositoryPath,
Entry entry,
GlobalOptions globalOptions)
Create or update the administration files for a particular file.
|
public void updateAdminData(String localDirectory, String repositoryPath, Entry entry, GlobalOptions globalOptions) throws IOException
updateAdminData
in interface AdminHandler
localDirectory
- the local directory where the file in question lives (the
absolute path). Must not end with a slash.entry
- the entry object for that file. If null, there is no entry to
add, and the Entries file will not have any entries added to
it (it will be created if it does not exist, however).repositoryPath
- the path of the file in the repositoryglobalOptions
- the global command optionsIOException
public boolean exists(File file)
exists
in interface AdminHandler
file
- file to test for existencepublic Entry getEntry(File file) throws IOException
getEntry
in interface AdminHandler
f
- the fileIOException
- if the Entries file cannot be readpublic Entry[] getEntriesAsArray(File directory) throws IOException
directory
- the directory for which to get the entriesIOException
public Iterator<Entry> getEntries(File directory) throws IOException
getEntries
in interface AdminHandler
directory
- the directory for which to get the entries (CVS/Entries is
appended)IOException
public void setEntry(File file, Entry entry) throws IOException
setEntry
in interface AdminHandler
f
- the file whose entry is being updatedIOException
- if an error occurs writing the detailspublic void removeEntry(File file) throws IOException
removeEntry
in interface AdminHandler
f
- the file whose entry is to be removedIOException
- if an error occurs writing the Entries filepublic String getRepositoryForDirectory(String directory, String repository) throws IOException
Repositoryin the CVS directory on the client. (This is the case in the standard CVS command-line tool). However, the path stored in that file is relative to the repository path
getRepositoryForDirectory
in interface AdminHandler
directory
- the directorythe
- repository path on the server, e.g. /home/bob/cvs. Must not
end with a slash.IOException
public Set<File> getAllFiles(File directory) throws IOException
getAllFiles
in interface AdminHandler
directory
- the directory to look inIOException
public String getStickyTagForDirectory(File directory)
getStickyTagForDirectory
in interface AdminHandler
Copyright © 2016. All rights reserved.