|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--allensoft.javacvs.client.WorkingDirectory
Represents a working directory for a CVS client. A working directory contains a "CVS" sub directory that contains files such as "Entries", "Root" and "Repository". This class provides a high level view of these files and the entries that the working directory conatins. For efficiency purposes one cannot construct objects of this class directly but instead one uses the getWorkingDirectory static method to construct them. This allows a cache to be maintained so that the files are not constantly reopened and parsed every time they are needed.
Field Summary | |
protected boolean |
m_bEntriesModified
true if the entries have been modified and need to be written to disk. |
Method Summary | |
void |
addWorkingDirectoryListener(WorkingDirectoryListener l)
|
boolean |
clearStaticDirectory()
Clears the static directory flag for this working directory. |
static void |
createWorkingDirectory(java.io.File directory,
RepositoryLocation repository,
java.lang.String sModule)
Creates a new CVS working directory. |
protected void |
fireEntryAdded(Entry entry)
|
protected void |
fireEntryRemoved(Entry entry)
|
protected void |
fireReloadedEntries()
|
java.lang.String |
getAbsoluteRepositoryPath()
Gets the absolute repossitory path for this working directory in the repository on the server. |
java.lang.String |
getCheckinProgram()
|
java.io.File |
getCVSFile(java.lang.String sName)
|
java.io.File |
getDirectory()
Gets the directory this working directory represents. |
DirectoryEntry[] |
getDirectoryEntries()
Gets all the directory entries in this working directory. |
Entry[] |
getEntries()
Gets all the entries in this working directory. |
java.io.File |
getEntriesFile()
Gets the file object that represents the "Entries" file within this working directory. |
Entry |
getEntry(java.io.File file)
Gets the Entry for the specified file. |
Entry |
getEntry(java.lang.String sName)
Gets a Entry with the specified name. |
FileEntry[] |
getFileEntries()
Gets all the file entries in this working directory without using recursion. |
FileEntry[] |
getFileEntries(boolean bRecursive)
Gets all file entries in this working directory with optional recursion. |
FileEntry[] |
getFileEntries(FileEntryFilter filter,
boolean bRecursive)
Gets all file entries in this working directory that are accepted by the supplied filter. |
java.lang.String |
getModulePath()
Gets the module path for this working directory. |
java.io.File |
getRepositoryFile()
Gets the file object that represents the "Repository" file within this working directory. |
RepositoryLocation |
getRepositoryLocation()
Gets the repository location for this working directory. |
java.io.File |
getRootFile()
Gets the file object that represents the "Root" file within this working directory. |
java.lang.String |
getStickyTagSpec()
Gets the sticky tag spec for this working directory. |
java.lang.String |
getUpdateProgram()
|
static WorkingDirectory |
getWorkingDirectory(DirectoryEntry entry)
Gets the WorkingDirectory object for the specified directory. |
static WorkingDirectory |
getWorkingDirectory(java.io.File directory)
Gets the WorkingDirectory object for the specified directory. |
static WorkingDirectory |
getWorkingDirectory(java.lang.String sDirectory)
Gets the WorkingDirectory object for the specified directory. |
boolean |
hasFileEntries(FileEntryFilter filter,
boolean bRecursive)
Checks if this working firectory has any file entries that match the filter. |
int |
hashCode()
|
boolean |
isStaticDirectory()
Checks if this working directory is a static directory. |
static boolean |
isWorkingDirectory(java.io.File directory)
Tests whether a particular directory is a CVS working directory or not. |
void |
loadEntriesFile()
Loads the entries file and parses it. |
void |
reloadEntriesFile()
Reloads the Entries file if necessary and updates the cache of entries. |
static void |
reloadEntriesFiles()
Realoads all Entries files for all working directories currently cached. |
void |
removeEntry(java.lang.String sName)
|
void |
removeWorkingDirectoryListener(WorkingDirectoryListener l)
|
boolean |
setStaticDirectory()
|
FileEntry |
updateFileEntry(java.lang.String name,
java.lang.String sRevision)
Updates the file entry in this working directory with the specified name and settings. |
void |
writeEntriesFile()
Writes the "Entries" file for this working directory to the standard CVS/Entries file. |
void |
writeEntriesFile(java.io.File entriesFile)
Writes the "Entries" file for this working directory to the supplied file. |
void |
writeEntriesFile(java.io.PrintWriter out)
Writes the "Entries" file for this working directory to the supplied PrintWriter. |
static void |
writeEntriesFiles()
Writes all "Entries" files that need to be written because entries have been modified in some working directories. |
void |
writeRepositoryFile()
|
void |
writeRepositoryFile(java.io.File rootFile)
|
void |
writeRepositoryFile(java.io.PrintWriter out)
Writes the "Repository" file to the supplied PrintWriter. |
void |
writeRootFile()
|
void |
writeRootFile(java.io.File rootFile)
|
void |
writeRootFile(java.io.PrintWriter out)
Writes the "Root" file to the supplied PrintWriter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean m_bEntriesModified
Method Detail |
public void addWorkingDirectoryListener(WorkingDirectoryListener l)
public void removeWorkingDirectoryListener(WorkingDirectoryListener l)
public int hashCode()
hashCode
in class java.lang.Object
public static WorkingDirectory getWorkingDirectory(java.io.File directory) throws java.io.IOException, CVSException
public static WorkingDirectory getWorkingDirectory(DirectoryEntry entry) throws java.io.IOException, CVSException
public static WorkingDirectory getWorkingDirectory(java.lang.String sDirectory) throws java.io.IOException, CVSException
public static boolean isWorkingDirectory(java.io.File directory)
public static void createWorkingDirectory(java.io.File directory, RepositoryLocation repository, java.lang.String sModule) throws java.io.IOException
public RepositoryLocation getRepositoryLocation()
public java.lang.String getModulePath()
public java.lang.String getAbsoluteRepositoryPath()
public Entry getEntry(java.io.File file)
public Entry getEntry(java.lang.String sName)
public boolean hasFileEntries(FileEntryFilter filter, boolean bRecursive) throws java.io.IOException, CVSException
public FileEntry[] getFileEntries(FileEntryFilter filter, boolean bRecursive) throws java.io.IOException, CVSException
bRecursive
is true then it will recursively scan directory entries in this working
directory, otherwise it only scans this working directory.public FileEntry[] getFileEntries(boolean bRecursive) throws java.io.IOException, CVSException
public FileEntry[] getFileEntries()
public DirectoryEntry[] getDirectoryEntries()
public Entry[] getEntries()
public void loadEntriesFile() throws java.io.IOException, InvalidEntryFormatException, InvalidKeywordSubstitutionModeException
public FileEntry updateFileEntry(java.lang.String name, java.lang.String sRevision) throws CVSException
public void removeEntry(java.lang.String sName)
public boolean isStaticDirectory()
public boolean setStaticDirectory() throws java.io.IOException
public boolean clearStaticDirectory()
public java.lang.String getStickyTagSpec() throws java.io.IOException
public java.lang.String getCheckinProgram() throws java.io.IOException
public java.lang.String getUpdateProgram() throws java.io.IOException
public void reloadEntriesFile() throws java.io.IOException, InvalidEntryFormatException, InvalidKeywordSubstitutionModeException
loadEntriesFile()
but only loads if the file has been modified.public static void reloadEntriesFiles() throws java.io.IOException, InvalidEntryFormatException, InvalidKeywordSubstitutionModeException
public void writeEntriesFile(java.io.PrintWriter out)
public void writeEntriesFile(java.io.File entriesFile) throws java.io.IOException
public void writeEntriesFile() throws java.io.IOException
public static void writeEntriesFiles() throws java.io.IOException
public void writeRootFile(java.io.PrintWriter out)
public void writeRootFile(java.io.File rootFile) throws java.io.IOException
public void writeRootFile() throws java.io.IOException
public void writeRepositoryFile(java.io.PrintWriter out)
public void writeRepositoryFile(java.io.File rootFile) throws java.io.IOException
public void writeRepositoryFile() throws java.io.IOException
public java.io.File getDirectory()
public java.io.File getCVSFile(java.lang.String sName)
public java.io.File getEntriesFile()
public java.io.File getRootFile()
public java.io.File getRepositoryFile()
protected void fireReloadedEntries()
protected void fireEntryAdded(Entry entry)
protected void fireEntryRemoved(Entry entry)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |