com.ice.cvsc
Class CVSEntry

java.lang.Object
  |
  +--com.ice.cvsc.CVSEntry
All Implemented Interfaces:
java.lang.Cloneable

public class CVSEntry
extends java.lang.Object
implements java.lang.Cloneable

CVSEntry implements the concept of a CVS Entry. Traditionally, a CVS Entry is a line in an 'Entries' file in a 'CVS' admin directory. A CVSEntry represents a CVS file that is checked in or being checked in. CVSEntry objects contain all of the relavent information about a CVS file, such as its name, check-out time, modification status, local pathname, repository, etc.

Version:
$Revision: 2.11 $
Author:
Timothy Gerard Endres, time@ice.com.
See Also:
CVSClient, CVSProject, CVSEntryVector

Nested Class Summary
 class CVSEntry.ChildEvent
           
static interface CVSEntry.ChildEventListener
           
 
Field Summary
static java.lang.String RCS_ID
           
static java.lang.String RCS_REV
           
 
Constructor Summary
CVSEntry()
           
 
Method Summary
 void addAllSubTreeEntries(CVSEntryVector vector)
          Adds all of the file entries in this directory entry, as well as every file entry in every subdirectory entry recursively.
 void addChildEventListener(CVSEntry.ChildEventListener l)
           
 void addFileEntries(CVSEntryVector vector)
          Adds all of the file entries in this directory entry to the vector supplied.
 void appendEntry(CVSEntry entry)
           
 java.lang.String completeTimestamp()
           
 java.lang.String dumpString()
           
 java.lang.String dumpString(java.lang.String prefix)
           
protected  void fireChildAddedEvent(CVSEntry.ChildEvent event)
           
protected  void fireChildRemovedEvent(CVSEntry.ChildEvent event)
           
 java.lang.String getAdminEntryLine()
           
 java.lang.String getArgumentName()
           
 CVSTimestamp getCVSTime()
          The cached CVSTimestamp (a subclass of Date), or null.
 java.lang.String getDate()
           
 CVSEntryVector getEntryList()
           
 java.lang.String getFullName()
           
 java.lang.String getFullPathName()
          This method was added when we finally decided to bite the bullet and change the naming scheme to work "correctly".
 java.lang.String getLocalDirectory()
           
 java.lang.String getLocalPathName()
          This method was added when we finally decided to bite the bullet and change the naming scheme to work "correctly".
 CVSMode getMode()
           
 java.lang.String getModeLine()
           
 java.lang.String getName()
           
 java.lang.String getOptions()
           
 java.lang.String getRepository()
           
 java.lang.String getRepositoryName()
           
 java.lang.String getServerEntryLine(boolean exists, boolean isModified)
           
 java.lang.String getTag()
           
 java.lang.String getTerseTimestamp()
           
 java.lang.String getTimestamp()
           
 java.lang.String getVersion()
           
 boolean isBinary()
           
 boolean isDirectory()
          Provides the directory-ness of this entry.
 boolean isDirty()
           
 boolean isForceModified()
           
 boolean isForceNoExistence()
           
 boolean isInConflict()
           
 boolean isLocalFileModified(java.io.File localFile)
           
 boolean isNewUserFile()
           
 boolean isNoUserFile()
           
 boolean isToBeRemoved()
           
 boolean isValid()
           
 CVSEntry locateEntry(java.lang.String name)
           
 void markForRemoval(boolean markState)
           
 java.lang.String padString(java.lang.String str, int width)
           
 boolean parseEntryLine(java.lang.String parseLine, boolean fromServer)
           
 void removeAllEntries()
           
 void removeChildEventListener(CVSEntry.ChildEventListener l)
           
 boolean removeEntry(CVSEntry entry)
           
 boolean removeEntry(java.lang.String entryName)
           
 void setConflict(java.io.File entryFile)
          NOTERefer to note under setTimestamp( File ) pertaining to the resolution of file times and CVS timestamps.
 void setDate(java.lang.String date)
           
 void setDirectoryEntryList(CVSEntryVector entryList)
          This method will make this entry a directory entry and establish its entry list with the list passed in the parameter.
 void setDirty(boolean dirty)
           
 void setForceModified(boolean forceModified)
           
 void setForceNoExistence(boolean forceNoExistence)
           
 void setLocalDirectory(java.lang.String directory)
           
 void setMode(CVSMode mode)
           
 void setName(java.lang.String name)
           
 void setNewUserFile(boolean isNew)
           
 void setNoUserFile(boolean isNo)
           
 void setOptions(java.lang.String options)
           
 void setRepository(java.lang.String repository)
           
 void setTag(java.lang.String tag)
           
 void setTimestamp(java.io.File entryFile)
          Set the timestamp of this entry to that of the modification time of the file passed to this method.
 void setTimestamp(java.lang.String timeStamp)
           
 void setToBeRemoved(boolean toBe)
           
 void setValid(boolean valid)
           
 void setVersion(java.lang.String version)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RCS_ID

public static final java.lang.String RCS_ID
See Also:
Constant Field Values

RCS_REV

public static final java.lang.String RCS_REV
See Also:
Constant Field Values
Constructor Detail

CVSEntry

public CVSEntry()
Method Detail

isValid

public boolean isValid()

setValid

public void setValid(boolean valid)

isDirty

public boolean isDirty()

setDirty

public void setDirty(boolean dirty)

isForceModified

public boolean isForceModified()

setForceModified

public void setForceModified(boolean forceModified)

isForceNoExistence

public boolean isForceNoExistence()

setForceNoExistence

public void setForceNoExistence(boolean forceNoExistence)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getRepository

public java.lang.String getRepository()

setRepository

public void setRepository(java.lang.String repository)

getLocalDirectory

public java.lang.String getLocalDirectory()

setLocalDirectory

public void setLocalDirectory(java.lang.String directory)

getFullName

public java.lang.String getFullName()

getFullPathName

public java.lang.String getFullPathName()
This method was added when we finally decided to bite the bullet and change the naming scheme to work "correctly". This will return the same string as getFullName(), except that the "./" prefix is removed. This is preferable for building file path names, hence the name.


getLocalPathName

public java.lang.String getLocalPathName()
This method was added when we finally decided to bite the bullet and change the naming scheme to work "correctly". This will return the same string as getLocalDirectory(), except that the "./" prefix is removed. This is preferable for building file path names, hence the name.


getRepositoryName

public java.lang.String getRepositoryName()

getArgumentName

public java.lang.String getArgumentName()

isDirectory

public boolean isDirectory()
Provides the directory-ness of this entry.

Returns:
True if this entry is a directory, else false.

appendEntry

public void appendEntry(CVSEntry entry)

removeEntry

public boolean removeEntry(CVSEntry entry)

removeEntry

public boolean removeEntry(java.lang.String entryName)

removeAllEntries

public void removeAllEntries()

locateEntry

public CVSEntry locateEntry(java.lang.String name)

getEntryList

public CVSEntryVector getEntryList()

setDirectoryEntryList

public void setDirectoryEntryList(CVSEntryVector entryList)
This method will make this entry a directory entry and establish its entry list with the list passed in the parameter. This is the only means of making a CVSEntry become a directory entry.

Parameters:
entryList - The directory's entry list.

getVersion

public java.lang.String getVersion()

setVersion

public void setVersion(java.lang.String version)

markForRemoval

public void markForRemoval(boolean markState)

getCVSTime

public CVSTimestamp getCVSTime()
The cached CVSTimestamp (a subclass of Date), or null.


getTimestamp

public java.lang.String getTimestamp()

completeTimestamp

public java.lang.String completeTimestamp()

getTerseTimestamp

public java.lang.String getTerseTimestamp()

setTimestamp

public void setTimestamp(java.io.File entryFile)
Set the timestamp of this entry to that of the modification time of the file passed to this method. NOTE There is an issue with timestamps between Java and CVS. Specifically, Java time uses millisecond resolution and CVS time uses second resolution. The problem arises when a file is "sync-ed" with the CVS/Entries timestamp and the file's modtime is stored with non-zero milliseconds. When we later compare the file's modtime to that of the CVSEntry's timestamp, they will differ by the milliseconds quantity. To solve this problem, we strip milliseconds from any file timestamp coming into jCVS. This forces all of the timestamps to have zero millisecond digits, which will compare properly with the CVS timestamps.


setTimestamp

public void setTimestamp(java.lang.String timeStamp)

setConflict

public void setConflict(java.io.File entryFile)
NOTERefer to note under setTimestamp( File ) pertaining to the resolution of file times and CVS timestamps.


getOptions

public java.lang.String getOptions()

setOptions

public void setOptions(java.lang.String options)

isBinary

public boolean isBinary()

getTag

public java.lang.String getTag()

setTag

public void setTag(java.lang.String tag)

getDate

public java.lang.String getDate()

setDate

public void setDate(java.lang.String date)

getMode

public CVSMode getMode()

setMode

public void setMode(CVSMode mode)

getModeLine

public java.lang.String getModeLine()

isNoUserFile

public boolean isNoUserFile()

setNoUserFile

public void setNoUserFile(boolean isNo)

isInConflict

public boolean isInConflict()

isNewUserFile

public boolean isNewUserFile()

setNewUserFile

public void setNewUserFile(boolean isNew)

isToBeRemoved

public boolean isToBeRemoved()

setToBeRemoved

public void setToBeRemoved(boolean toBe)

isLocalFileModified

public boolean isLocalFileModified(java.io.File localFile)

parseEntryLine

public boolean parseEntryLine(java.lang.String parseLine,
                              boolean fromServer)
                       throws java.text.ParseException
java.text.ParseException

padString

public java.lang.String padString(java.lang.String str,
                                  int width)

getAdminEntryLine

public java.lang.String getAdminEntryLine()

getServerEntryLine

public java.lang.String getServerEntryLine(boolean exists,
                                           boolean isModified)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

addFileEntries

public void addFileEntries(CVSEntryVector vector)
Adds all of the file entries in this directory entry to the vector supplied.

Parameters:
vector - The vector to add the file entries to.

addAllSubTreeEntries

public void addAllSubTreeEntries(CVSEntryVector vector)
Adds all of the file entries in this directory entry, as well as every file entry in every subdirectory entry recursively.

Parameters:
vector - The vector to add the file entries to.

fireChildAddedEvent

protected void fireChildAddedEvent(CVSEntry.ChildEvent event)

fireChildRemovedEvent

protected void fireChildRemovedEvent(CVSEntry.ChildEvent event)

addChildEventListener

public void addChildEventListener(CVSEntry.ChildEventListener l)

removeChildEventListener

public void removeChildEventListener(CVSEntry.ChildEventListener l)

dumpString

public java.lang.String dumpString()

dumpString

public java.lang.String dumpString(java.lang.String prefix)


Copyright © 1997-2003, Timothy G. Endres, All Rights Reserved.