org.netbeans.lib.cvsclient.admin
Interface AdminHandler

All Known Implementing Classes:
StandardAdminHandler

public interface AdminHandler

Handles the maintaining and reading of administration information on the local machine. The standard CVS client does this by putting various files in a CVS directory underneath each checked-out directory. How the files are laid out and managed is not specified by the protocol document.

Hence it is envisaged that, eventually, a client could add additional files for higher performance or even change the mechanism for storing the information completely.


Method Summary
 boolean exists(java.io.File file)
          Tests for existence of the given file.
 java.util.Set getAllFiles(java.io.File directory)
          Get all the files contained within a given directory that are known to CVS.
 java.util.Iterator getEntries(java.io.File directory)
          Get the entries for a specified directory.
 Entry getEntry(java.io.File file)
          Get the Entry for the specified file, if one exists
 java.lang.String getRepositoryForDirectory(java.lang.String directory, java.lang.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.
 java.lang.String getStickyTagForDirectory(java.io.File directory)
          Checks for presence of CVS/Tag file and returns it's value.
 void removeEntry(java.io.File file)
          Remove the Entry for the specified file
 void setEntry(java.io.File file, Entry entry)
          Set the Entry for the specified file
 void updateAdminData(java.lang.String localDirectory, java.lang.String repositoryPath, Entry entry, GlobalOptions globalOptions)
          Create or update the administration files for a particular file.
 

Method Detail

updateAdminData

void updateAdminData(java.lang.String localDirectory,
                     java.lang.String repositoryPath,
                     Entry entry,
                     GlobalOptions globalOptions)
                     throws java.io.IOException
Create or update the administration files for a particular file. This will create the CVS directory if necessary, and the Root and Repository files if necessary. It will also update the Entries file with the new entry

Parameters:
localDirectory - the local directory where the file in question lives (the absolute path). Must not end with a slash.
repositoryPath - the path of the file in the repository
entry - the entry object for that file
globalOptions - the global command options
Throws:
java.io.IOException

getEntry

Entry getEntry(java.io.File file)
               throws java.io.IOException
Get the Entry for the specified file, if one exists

Parameters:
file - the file
Throws:
java.io.IOException - if the Entries file cannot be read

getEntries

java.util.Iterator getEntries(java.io.File directory)
                              throws java.io.IOException
Get the entries for a specified directory.

Parameters:
directory - the directory for which to get the entries
Returns:
an iterator of Entry objects
Throws:
java.io.IOException

setEntry

void setEntry(java.io.File file,
              Entry entry)
              throws java.io.IOException
Set the Entry for the specified file

Parameters:
file - the file
entry - the new entry
Throws:
java.io.IOException - if an error occurs writing the details

getRepositoryForDirectory

java.lang.String getRepositoryForDirectory(java.lang.String directory,
                                           java.lang.String repository)
                                           throws java.io.IOException
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. The repository directory is commonly stored in the file
Repository
in the CVS directory on the client. (This is the case in the standard CVS command-line tool)

Parameters:
directory - the directory
the - repository path on the server, e.g. /home/bob/cvs. Must not end with a slash.
Throws:
java.io.IOException

removeEntry

void removeEntry(java.io.File file)
                 throws java.io.IOException
Remove the Entry for the specified file

Parameters:
file - the file whose entry is to be removed
Throws:
java.io.IOException - if an error occurs writing the Entries file

getAllFiles

java.util.Set getAllFiles(java.io.File directory)
                          throws java.io.IOException
Get all the files contained within a given directory that are known to CVS.

Parameters:
directory - the directory to look in
Returns:
a set of all files.
Throws:
java.io.IOException

getStickyTagForDirectory

java.lang.String getStickyTagForDirectory(java.io.File directory)
Checks for presence of CVS/Tag file and returns it's value.

Returns:
the value of CVS/Tag file for the specified directory (including leading "T") null if file doesn't exist

exists

boolean exists(java.io.File file)
Tests for existence of the given file. Normally this method delegates to File.exists() but it may also return true for files that exists only virtually (in memory). Is such case the file/directory will not exist on disk but its metadata will be available via getEntries() methods.

Parameters:
file - file to test for existence
Returns:
true if the file exists, false otherwise

 

Built on August 7 2008.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.